OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_NAVIGATOR_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_NAVIGATOR_H_ |
6 #define CHROME_BROWSER_UI_BROWSER_NAVIGATOR_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_NAVIGATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "content/common/page_transition_types.h" | 11 #include "content/public/common/page_transition_types.h" |
12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
13 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
14 #include "webkit/glue/window_open_disposition.h" | 14 #include "webkit/glue/window_open_disposition.h" |
15 | 15 |
16 class Browser; | 16 class Browser; |
17 class Profile; | 17 class Profile; |
18 class TabContentsWrapper; | 18 class TabContentsWrapper; |
19 | 19 |
20 namespace browser { | 20 namespace browser { |
21 | 21 |
(...skipping 14 matching lines...) Expand all Loading... |
36 // Opens a popup TabContents: | 36 // Opens a popup TabContents: |
37 // browser::NavigateParams params(browser, popup_contents); | 37 // browser::NavigateParams params(browser, popup_contents); |
38 // params.source_contents = source_contents; | 38 // params.source_contents = source_contents; |
39 // browser::Navigate(¶ms); | 39 // browser::Navigate(¶ms); |
40 // | 40 // |
41 // See browser_navigator_browsertest.cc for more examples. | 41 // See browser_navigator_browsertest.cc for more examples. |
42 // | 42 // |
43 struct NavigateParams { | 43 struct NavigateParams { |
44 NavigateParams(Browser* browser, | 44 NavigateParams(Browser* browser, |
45 const GURL& a_url, | 45 const GURL& a_url, |
46 PageTransition::Type a_transition); | 46 content::PageTransition a_transition); |
47 NavigateParams(Browser* browser, TabContentsWrapper* a_target_contents); | 47 NavigateParams(Browser* browser, TabContentsWrapper* a_target_contents); |
48 ~NavigateParams(); | 48 ~NavigateParams(); |
49 | 49 |
50 // The URL/referrer to be loaded. Ignored if |target_contents| is non-NULL. | 50 // The URL/referrer to be loaded. Ignored if |target_contents| is non-NULL. |
51 GURL url; | 51 GURL url; |
52 GURL referrer; | 52 GURL referrer; |
53 | 53 |
54 // [in] A TabContents to be navigated or inserted into the target Browser's | 54 // [in] A TabContents to be navigated or inserted into the target Browser's |
55 // tabstrip. If NULL, |url| or the homepage will be used instead. When | 55 // tabstrip. If NULL, |url| or the homepage will be used instead. When |
56 // non-NULL, Navigate() assumes it has already been navigated to its | 56 // non-NULL, Navigate() assumes it has already been navigated to its |
(...skipping 28 matching lines...) Expand all Loading... |
85 // | 85 // |
86 // If disposition is NEW_BACKGROUND_TAB, TabStripModel::ADD_ACTIVE is | 86 // If disposition is NEW_BACKGROUND_TAB, TabStripModel::ADD_ACTIVE is |
87 // removed from |tabstrip_add_types| automatically. | 87 // removed from |tabstrip_add_types| automatically. |
88 // If disposition is one of NEW_WINDOW, NEW_POPUP, NEW_FOREGROUND_TAB or | 88 // If disposition is one of NEW_WINDOW, NEW_POPUP, NEW_FOREGROUND_TAB or |
89 // SINGLETON_TAB, then TabStripModel::ADD_ACTIVE is automatically added to | 89 // SINGLETON_TAB, then TabStripModel::ADD_ACTIVE is automatically added to |
90 // |tabstrip_add_types|. | 90 // |tabstrip_add_types|. |
91 WindowOpenDisposition disposition; | 91 WindowOpenDisposition disposition; |
92 | 92 |
93 // The transition type of the navigation. Default is PageTransition::LINK | 93 // The transition type of the navigation. Default is PageTransition::LINK |
94 // when target_contents is specified in the constructor. | 94 // when target_contents is specified in the constructor. |
95 PageTransition::Type transition; | 95 content::PageTransition transition; |
96 | 96 |
97 // The index the caller would like the tab to be positioned at in the | 97 // The index the caller would like the tab to be positioned at in the |
98 // TabStrip. The actual index will be determined by the TabHandler in | 98 // TabStrip. The actual index will be determined by the TabHandler in |
99 // accordance with |add_types|. Defaults to -1 (allows the TabHandler to | 99 // accordance with |add_types|. Defaults to -1 (allows the TabHandler to |
100 // decide). | 100 // decide). |
101 int tabstrip_index; | 101 int tabstrip_index; |
102 | 102 |
103 // A bitmask of values defined in TabStripModel::AddTabTypes. Helps | 103 // A bitmask of values defined in TabStripModel::AddTabTypes. Helps |
104 // determine where to insert a new tab and whether or not it should be | 104 // determine where to insert a new tab and whether or not it should be |
105 // selected, among other properties. Default is ADD_ACTIVE. | 105 // selected, among other properties. Default is ADD_ACTIVE. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // Navigates according to the configuration specified in |params|. | 184 // Navigates according to the configuration specified in |params|. |
185 void Navigate(NavigateParams* params); | 185 void Navigate(NavigateParams* params); |
186 | 186 |
187 // If the given navigational URL is a Singleton, return the tab index for it. | 187 // If the given navigational URL is a Singleton, return the tab index for it. |
188 // Otherwise, returns -1. | 188 // Otherwise, returns -1. |
189 int GetIndexOfSingletonTab(NavigateParams* params); | 189 int GetIndexOfSingletonTab(NavigateParams* params); |
190 | 190 |
191 } // namespace browser | 191 } // namespace browser |
192 | 192 |
193 #endif // CHROME_BROWSER_UI_BROWSER_NAVIGATOR_H_ | 193 #endif // CHROME_BROWSER_UI_BROWSER_NAVIGATOR_H_ |
OLD | NEW |