[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_UI_BROWSER_TABSTRIP_H_ |
| 6 | #define CHROME_BROWSER_UI_BROWSER_TABSTRIP_H_ |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 7 | |
[email protected] | d1198fd | 2012-08-13 22:50:19 | [diff] [blame] | 8 | #include "content/public/browser/navigation_controller.h" |
[email protected] | 54944cde | 2012-12-09 09:24:59 | [diff] [blame] | 9 | #include "content/public/browser/web_contents.h" |
Sylvain Defresne | c6ccc77d | 2014-09-19 10:19:35 | [diff] [blame] | 10 | #include "ui/base/page_transition_types.h" |
[email protected] | f47621b | 2013-01-22 20:50:33 | [diff] [blame] | 11 | #include "ui/base/window_open_disposition.h" |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 12 | |
| 13 | class Browser; |
| 14 | class GURL; |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 15 | |
| 16 | namespace gfx { |
| 17 | class Rect; |
| 18 | } |
| 19 | |
| 20 | namespace chrome { |
| 21 | |
[email protected] | 73765a77 | 2013-11-15 23:42:16 | [diff] [blame] | 22 | // Adds a tab to the tab strip of the specified browser and loads |url| into it. |
| 23 | // If |url| is an empty URL, then the new tab-page is laoded. An |index| of -1 |
| 24 | // means to append it to the end of the tab strip. |
[email protected] | 00509a3 | 2013-11-17 17:45:37 | [diff] [blame] | 25 | void AddTabAt(Browser* browser, const GURL& url, int index, bool foreground); |
[email protected] | 85537005 | 2012-07-10 19:30:32 | [diff] [blame] | 26 | |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 27 | // Adds a selected tab with the specified URL and transition, returns the |
[email protected] | 371d64a | 2012-12-14 21:11:32 | [diff] [blame] | 28 | // created WebContents. |
[email protected] | 5a1a5246 | 2012-11-15 03:35:16 | [diff] [blame] | 29 | content::WebContents* AddSelectedTabWithURL(Browser* browser, |
| 30 | const GURL& url, |
Sylvain Defresne | c6ccc77d | 2014-09-19 10:19:35 | [diff] [blame] | 31 | ui::PageTransition transition); |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 32 | |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 33 | // Creates a new tab with the already-created WebContents 'new_contents'. |
| 34 | // The window for the added contents will be reparented correctly when this |
bokan | 107a47f | 2015-02-03 23:23:39 | [diff] [blame] | 35 | // method returns. If |disposition| is NEW_POPUP, |initial_rect| should hold |
Charles Harrison | aeef8749 | 2017-09-12 20:39:25 | [diff] [blame] | 36 | // the initial position and size. |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 37 | void AddWebContents(Browser* browser, |
| 38 | content::WebContents* source_contents, |
erikchen | bee5c962 | 2018-04-27 19:30:25 | [diff] [blame] | 39 | std::unique_ptr<content::WebContents> new_contents, |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 40 | WindowOpenDisposition disposition, |
Mustaq Ahmed | ee456c6 | 2018-05-18 20:48:50 | [diff] [blame^] |
|