OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BROWSER_NAVIGATOR_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_NAVIGATOR_H_ |
6 #define CHROME_BROWSER_BROWSER_NAVIGATOR_H_ | 6 #define CHROME_BROWSER_BROWSER_NAVIGATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/common/page_transition_types.h" | 10 #include "chrome/common/page_transition_types.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 TabContents* target_contents; | 78 TabContents* target_contents; |
79 | 79 |
80 // [in] The TabContents that initiated the Navigate() request if such context | 80 // [in] The TabContents that initiated the Navigate() request if such context |
81 // is necessary. Default is NULL, i.e. no context. | 81 // is necessary. Default is NULL, i.e. no context. |
82 // [out] If NULL, this value will be set to the selected TabContents in the | 82 // [out] If NULL, this value will be set to the selected TabContents in the |
83 // originating browser prior to the operation performed by Navigate(). | 83 // originating browser prior to the operation performed by Navigate(). |
84 TabContents* source_contents; | 84 TabContents* source_contents; |
85 | 85 |
86 // The disposition requested by the navigation source. Default is | 86 // The disposition requested by the navigation source. Default is |
87 // CURRENT_TAB. | 87 // CURRENT_TAB. |
| 88 // If disposition is NEW_WINDOW or NEW_POPUP, |show_window| is set to true |
| 89 // automatically. |
| 90 // If disposition is NEW_BACKGROUND_TAB, TabStripModel::ADD_SELECTED is |
| 91 // removed from |tabstrip_add_types| automatically. |
| 92 // If disposition is one of NEW_WINDOW, NEW_POPUP, NEW_FOREGROUND_TAB or |
| 93 // SINGLETON_TAB, then TabStripModel::ADD_SELECTED is automatically added to |
| 94 // |tabstrip_add_types|. |
88 WindowOpenDisposition disposition; | 95 WindowOpenDisposition disposition; |
89 | 96 |
90 // The transition type of the navigation. Default is PageTransition::LINK | 97 // The transition type of the navigation. Default is PageTransition::LINK |
91 // when target_contents is specified in the constructor. | 98 // when target_contents is specified in the constructor. |
92 PageTransition::Type transition; | 99 PageTransition::Type transition; |
93 | 100 |
94 // The index the caller would like the tab to be positioned at in the | 101 // The index the caller would like the tab to be positioned at in the |
95 // TabStrip. The actual index will be determined by the TabHandler in | 102 // TabStrip. The actual index will be determined by the TabHandler in |
96 // accordance with |add_types|. Defaults to -1 (allows the TabHandler to | 103 // accordance with |add_types|. Defaults to -1 (allows the TabHandler to |
97 // decide). | 104 // decide). |
98 int tabstrip_index; | 105 int tabstrip_index; |
99 | 106 |
100 // A bitmask of values defined in TabStripModel::AddTabTypes. Helps | 107 // A bitmask of values defined in TabStripModel::AddTabTypes. Helps |
101 // determine where to insert a new tab and whether or not it should be | 108 // determine where to insert a new tab and whether or not it should be |
102 // selected, among other properties. Default is ADD_SELECTED. | 109 // selected, among other properties. Default is ADD_SELECTED. |
103 int tabstrip_add_types; | 110 int tabstrip_add_types; |
104 | 111 |
105 // If non-empty, the new tab is an app tab. | 112 // If non-empty, the new tab is an app tab. |
106 std::string extension_app_id; | 113 std::string extension_app_id; |
107 | 114 |
108 // If non-empty, specifies the desired initial position and size of the | 115 // If non-empty, specifies the desired initial position and size of the |
109 // window if |disposition| == NEW_POPUP. | 116 // window if |disposition| == NEW_POPUP. |
110 // TODO(beng): Figure out if this can be used to create Browser windows | 117 // TODO(beng): Figure out if this can be used to create Browser windows |
111 // for other callsites that use set_override_bounds, or | 118 // for other callsites that use set_override_bounds, or |
112 // remove this comment. | 119 // remove this comment. |
113 gfx::Rect window_bounds; | 120 gfx::Rect window_bounds; |
114 | 121 |
115 // True if the target window should be made visible at the end of the call | 122 // True if the target window should be made visible at the end of the call |
116 // to Navigate(). Default is false. | 123 // to Navigate(). Default is false. |
| 124 // If disposition is NEW_WINDOW or NEW_POPUP, |show_window| is set to true |
| 125 // automatically. |
117 bool show_window; | 126 bool show_window; |
118 | 127 |
119 // [in] Specifies a Browser object where the navigation could occur or the | 128 // [in] Specifies a Browser object where the navigation could occur or the |
120 // tab could be added. Navigate() is not obliged to use this Browser if | 129 // tab could be added. Navigate() is not obliged to use this Browser if |
121 // it is not compatible with the operation being performed. Cannot be | 130 // it is not compatible with the operation being performed. Cannot be |
122 // NULL since Navigate() uses this Browser's Profile. | 131 // NULL since Navigate() uses this Browser's Profile. |
123 // [out] Specifies the Browser object where the navigation occurred or the | 132 // [out] Specifies the Browser object where the navigation occurred or the |
124 // tab was added. Guaranteed non-NULL unless the disposition did not | 133 // tab was added. Guaranteed non-NULL unless the disposition did not |
125 // require a navigation, in which case this is set to NULL | 134 // require a navigation, in which case this is set to NULL |
126 // (SUPPRESS_OPEN, SAVE_TO_DISK, IGNORE_ACTION). | 135 // (SUPPRESS_OPEN, SAVE_TO_DISK, IGNORE_ACTION). |
127 // Note: If |show_window| is set to false and a new Browser is created by | 136 // Note: If |show_window| is set to false and a new Browser is created by |
128 // Navigate(), the caller is responsible for showing it so that its | 137 // Navigate(), the caller is responsible for showing it so that its |
129 // window can assume responsibility for the Browser's lifetime (Browser | 138 // window can assume responsibility for the Browser's lifetime (Browser |
130 // objects are deleted when the user closes a visible browser window). | 139 // objects are deleted when the user closes a visible browser window). |
131 Browser* browser; | 140 Browser* browser; |
132 | 141 |
133 private: | 142 private: |
134 NavigateParams(); | 143 NavigateParams(); |
135 }; | 144 }; |
136 | 145 |
137 // Navigates according to the configuration specified in |params|. | 146 // Navigates according to the configuration specified in |params|. |
138 void Navigate(NavigateParams* params, NavigatorDelegate* delegate); | 147 void Navigate(NavigateParams* params, NavigatorDelegate* delegate); |
139 | 148 |
140 } // namespace browser | 149 } // namespace browser |
141 | 150 |
142 #endif // CHROME_BROWSER_BROWSER_NAVIGATOR_H_ | 151 #endif // CHROME_BROWSER_BROWSER_NAVIGATOR_H_ |
143 | 152 |
OLD | NEW |