OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PARAMS_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_NAVIGATOR_PARAMS_H_ |
6 #define CHROME_BROWSER_UI_BROWSER_NAVIGATOR_PARAMS_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_NAVIGATOR_PARAMS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // chrome::NavigateParams params(browser, popup_contents); | 49 // chrome::NavigateParams params(browser, popup_contents); |
50 // params.source_contents = source_contents; | 50 // params.source_contents = source_contents; |
51 // chrome::Navigate(¶ms); | 51 // chrome::Navigate(¶ms); |
52 // | 52 // |
53 // See browser_navigator_browsertest.cc for more examples. | 53 // See browser_navigator_browsertest.cc for more examples. |
54 | 54 |
55 // TODO(thestig): Split or ifdef out more fields that are not used on Android. | 55 // TODO(thestig): Split or ifdef out more fields that are not used on Android. |
56 struct NavigateParams { | 56 struct NavigateParams { |
57 #if defined(OS_ANDROID) | 57 #if defined(OS_ANDROID) |
58 explicit NavigateParams(content::WebContents* a_target_contents); | 58 explicit NavigateParams(content::WebContents* a_target_contents); |
59 #endif | 59 #else |
60 #if !defined(OS_ANDROID) || defined(USE_AURA) | |
61 NavigateParams(Browser* browser, | 60 NavigateParams(Browser* browser, |
62 const GURL& a_url, | 61 const GURL& a_url, |
63 ui::PageTransition a_transition); | 62 ui::PageTransition a_transition); |
64 NavigateParams(Browser* browser, | 63 NavigateParams(Browser* browser, |
65 content::WebContents* a_target_contents); | 64 content::WebContents* a_target_contents); |
66 #endif | 65 #endif |
67 NavigateParams(Profile* profile, | 66 NavigateParams(Profile* profile, |
68 const GURL& a_url, | 67 const GURL& a_url, |
69 ui::PageTransition a_transition); | 68 ui::PageTransition a_transition); |
70 ~NavigateParams(); | 69 ~NavigateParams(); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // What to do with the ref component of the URL for singleton navigations. | 199 // What to do with the ref component of the URL for singleton navigations. |
201 enum RefBehavior { | 200 enum RefBehavior { |
202 // Two URLs with differing refs are same. | 201 // Two URLs with differing refs are same. |
203 IGNORE_REF, | 202 IGNORE_REF, |
204 // Two URLs with differing refs are different. | 203 // Two URLs with differing refs are different. |
205 RESPECT_REF, | 204 RESPECT_REF, |
206 }; | 205 }; |
207 // Default is IGNORE. | 206 // Default is IGNORE. |
208 RefBehavior ref_behavior; | 207 RefBehavior ref_behavior; |
209 | 208 |
210 #if !defined(OS_ANDROID) || defined(USE_AURA) | 209 #if !defined(OS_ANDROID) |
211 // [in] Specifies a Browser object where the navigation could occur or the | 210 // [in] Specifies a Browser object where the navigation could occur or the |
212 // tab could be added. Navigate() is not obliged to use this Browser if | 211 // tab could be added. Navigate() is not obliged to use this Browser if |
213 // it is not compatible with the operation being performed. This can be | 212 // it is not compatible with the operation being performed. This can be |
214 // NULL, in which case |initiating_profile| must be provided. | 213 // NULL, in which case |initiating_profile| must be provided. |
215 // [out] Specifies the Browser object where the navigation occurred or the | 214 // [out] Specifies the Browser object where the navigation occurred or the |
216 // tab was added. Guaranteed non-NULL unless the disposition did not | 215 // tab was added. Guaranteed non-NULL unless the disposition did not |
217 // require a navigation, in which case this is set to NULL | 216 // require a navigation, in which case this is set to NULL |
218 // (SUPPRESS_OPEN, SAVE_TO_DISK, IGNORE_ACTION). | 217 // (SUPPRESS_OPEN, SAVE_TO_DISK, IGNORE_ACTION). |
219 // Note: If |show_window| is set to false and a new Browser is created by | 218 // Note: If |show_window| is set to false and a new Browser is created by |
220 // Navigate(), the caller is responsible for showing it so that its | 219 // Navigate(), the caller is responsible for showing it so that its |
(...skipping 28 matching lines...) Expand all Loading... |
249 NavigateParams(); | 248 NavigateParams(); |
250 }; | 249 }; |
251 | 250 |
252 // Copies fields from |params| struct to |nav_params| struct. | 251 // Copies fields from |params| struct to |nav_params| struct. |
253 void FillNavigateParamsFromOpenURLParams(chrome::NavigateParams* nav_params, | 252 void FillNavigateParamsFromOpenURLParams(chrome::NavigateParams* nav_params, |
254 const content::OpenURLParams& params); | 253 const content::OpenURLParams& params); |
255 | 254 |
256 } // namespace chrome | 255 } // namespace chrome |
257 | 256 |
258 #endif // CHROME_BROWSER_UI_BROWSER_NAVIGATOR_PARAMS_H_ | 257 #endif // CHROME_BROWSER_UI_BROWSER_NAVIGATOR_PARAMS_H_ |
OLD | NEW |