OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_BROWSER_TABSTRIP_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_TABSTRIP_H_ |
6 #define CHROME_BROWSER_UI_BROWSER_TABSTRIP_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_TABSTRIP_H_ |
7 | 7 |
8 #include "content/public/browser/navigation_controller.h" | 8 #include "content/public/browser/navigation_controller.h" |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 #include "content/public/common/page_transition_types.h" | 10 #include "ui/base/page_transition_types.h" |
11 #include "ui/base/window_open_disposition.h" | 11 #include "ui/base/window_open_disposition.h" |
12 | 12 |
13 class Browser; | 13 class Browser; |
14 class GURL; | 14 class GURL; |
15 class Profile; | 15 class Profile; |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class SiteInstance; | 18 class SiteInstance; |
19 } | 19 } |
20 | 20 |
21 namespace gfx { | 21 namespace gfx { |
22 class Rect; | 22 class Rect; |
23 } | 23 } |
24 | 24 |
25 namespace chrome { | 25 namespace chrome { |
26 | 26 |
27 // Adds a tab to the tab strip of the specified browser and loads |url| into it. | 27 // Adds a tab to the tab strip of the specified browser and loads |url| into it. |
28 // If |url| is an empty URL, then the new tab-page is laoded. An |index| of -1 | 28 // If |url| is an empty URL, then the new tab-page is laoded. An |index| of -1 |
29 // means to append it to the end of the tab strip. | 29 // means to append it to the end of the tab strip. |
30 void AddTabAt(Browser* browser, const GURL& url, int index, bool foreground); | 30 void AddTabAt(Browser* browser, const GURL& url, int index, bool foreground); |
31 | 31 |
32 // Adds a selected tab with the specified URL and transition, returns the | 32 // Adds a selected tab with the specified URL and transition, returns the |
33 // created WebContents. | 33 // created WebContents. |
34 content::WebContents* AddSelectedTabWithURL(Browser* browser, | 34 content::WebContents* AddSelectedTabWithURL(Browser* browser, |
35 const GURL& url, | 35 const GURL& url, |
36 content::PageTransition transition); | 36 ui::PageTransition transition); |
37 | 37 |
38 // Creates a new tab with the already-created WebContents 'new_contents'. | 38 // Creates a new tab with the already-created WebContents 'new_contents'. |
39 // The window for the added contents will be reparented correctly when this | 39 // The window for the added contents will be reparented correctly when this |
40 // method returns. If |disposition| is NEW_POPUP, |pos| should hold the | 40 // method returns. If |disposition| is NEW_POPUP, |pos| should hold the |
41 // initial position. If |was_blocked| is non-NULL, then |*was_blocked| will be | 41 // initial position. If |was_blocked| is non-NULL, then |*was_blocked| will be |
42 // set to true if the popup gets blocked, and left unchanged otherwise. | 42 // set to true if the popup gets blocked, and left unchanged otherwise. |
43 void AddWebContents(Browser* browser, | 43 void AddWebContents(Browser* browser, |
44 content::WebContents* source_contents, | 44 content::WebContents* source_contents, |
45 content::WebContents* new_contents, | 45 content::WebContents* new_contents, |
46 WindowOpenDisposition disposition, | 46 WindowOpenDisposition disposition, |
47 const gfx::Rect& initial_pos, | 47 const gfx::Rect& initial_pos, |
48 bool user_gesture, | 48 bool user_gesture, |
49 bool* was__blocked); | 49 bool* was__blocked); |
50 | 50 |
51 // Closes the specified WebContents in the specified Browser. If | 51 // Closes the specified WebContents in the specified Browser. If |
52 // |add_to_history| is true, an entry in the historical tab database is created. | 52 // |add_to_history| is true, an entry in the historical tab database is created. |
53 void CloseWebContents(Browser* browser, | 53 void CloseWebContents(Browser* browser, |
54 content::WebContents* contents, | 54 content::WebContents* contents, |
55 bool add_to_history); | 55 bool add_to_history); |
56 | 56 |
57 } // namespace chrome | 57 } // namespace chrome |
58 | 58 |
59 #endif // CHROME_BROWSER_UI_BROWSER_TABSTRIP_H_ | 59 #endif // CHROME_BROWSER_UI_BROWSER_TABSTRIP_H_ |
OLD | NEW |