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 #include "chrome/browser/ui/browser_navigator_params.h" | 5 #include "chrome/browser/ui/browser_navigator_params.h" |
6 | 6 |
7 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 7 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
8 #include "content/public/browser/navigation_controller.h" | 8 #include "content/public/browser/navigation_controller.h" |
9 #include "content/public/browser/page_navigator.h" | 9 #include "content/public/browser/page_navigator.h" |
10 | 10 |
11 #if !defined(OS_ANDROID) | 11 #if !defined(OS_ANDROID) || defined(USE_AURA) |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/host_desktop.h" | 13 #include "chrome/browser/ui/host_desktop.h" |
14 #endif | 14 #endif |
15 | 15 |
16 using content::GlobalRequestID; | 16 using content::GlobalRequestID; |
17 using content::NavigationController; | 17 using content::NavigationController; |
18 using content::WebContents; | 18 using content::WebContents; |
19 | 19 |
20 namespace chrome { | 20 namespace chrome { |
21 | 21 |
22 #if !defined(OS_ANDROID) | 22 #if !defined(OS_ANDROID) || defined(USE_AURA) |
23 namespace { | 23 namespace { |
24 | 24 |
25 HostDesktopType GetHostDesktop(Browser* browser) { | 25 HostDesktopType GetHostDesktop(Browser* browser) { |
26 if (browser) | 26 if (browser) |
27 return browser->host_desktop_type(); | 27 return browser->host_desktop_type(); |
28 return GetActiveDesktop(); | 28 return GetActiveDesktop(); |
29 } | 29 } |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 #endif | 32 #endif |
(...skipping 12 matching lines...) Expand all Loading... |
45 tabstrip_add_types(TabStripModel::ADD_ACTIVE), | 45 tabstrip_add_types(TabStripModel::ADD_ACTIVE), |
46 window_action(NO_ACTION), | 46 window_action(NO_ACTION), |
47 user_gesture(true), | 47 user_gesture(true), |
48 path_behavior(RESPECT), | 48 path_behavior(RESPECT), |
49 ref_behavior(IGNORE_REF), | 49 ref_behavior(IGNORE_REF), |
50 initiating_profile(nullptr), | 50 initiating_profile(nullptr), |
51 host_desktop_type(GetActiveDesktop()), | 51 host_desktop_type(GetActiveDesktop()), |
52 should_replace_current_entry(false), | 52 should_replace_current_entry(false), |
53 created_with_opener(false) { | 53 created_with_opener(false) { |
54 } | 54 } |
55 #else | 55 #endif // defined(OS_ANDROID) |
| 56 |
| 57 #if !defined(OS_ANDROID) || defined(USE_AURA) |
56 NavigateParams::NavigateParams(Browser* a_browser, | 58 NavigateParams::NavigateParams(Browser* a_browser, |
57 const GURL& a_url, | 59 const GURL& a_url, |
58 ui::PageTransition a_transition) | 60 ui::PageTransition a_transition) |
59 : url(a_url), | 61 : url(a_url), |
60 frame_tree_node_id(-1), | 62 frame_tree_node_id(-1), |
61 uses_post(false), | 63 uses_post(false), |
62 target_contents(NULL), | 64 target_contents(NULL), |
63 source_contents(NULL), | 65 source_contents(NULL), |
64 disposition(CURRENT_TAB), | 66 disposition(CURRENT_TAB), |
65 trusted_source(false), | 67 trusted_source(false), |
(...skipping 27 matching lines...) Expand all Loading... |
93 window_action(NO_ACTION), | 95 window_action(NO_ACTION), |
94 user_gesture(true), | 96 user_gesture(true), |
95 path_behavior(RESPECT), | 97 path_behavior(RESPECT), |
96 ref_behavior(IGNORE_REF), | 98 ref_behavior(IGNORE_REF), |
97 browser(a_browser), | 99 browser(a_browser), |
98 initiating_profile(NULL), | 100 initiating_profile(NULL), |
99 host_desktop_type(GetHostDesktop(a_browser)), | 101 host_desktop_type(GetHostDesktop(a_browser)), |
100 should_replace_current_entry(false), | 102 should_replace_current_entry(false), |
101 created_with_opener(false) { | 103 created_with_opener(false) { |
102 } | 104 } |
103 #endif // !defined(OS_ANDROID) | 105 #endif // !defined(OS_ANDROID) || defined(USE_AURA) |
104 | 106 |
105 NavigateParams::NavigateParams(Profile* a_profile, | 107 NavigateParams::NavigateParams(Profile* a_profile, |
106 const GURL& a_url, | 108 const GURL& a_url, |
107 ui::PageTransition a_transition) | 109 ui::PageTransition a_transition) |
108 : url(a_url), | 110 : url(a_url), |
109 frame_tree_node_id(-1), | 111 frame_tree_node_id(-1), |
110 uses_post(false), | 112 uses_post(false), |
111 target_contents(NULL), | 113 target_contents(NULL), |
112 source_contents(NULL), | 114 source_contents(NULL), |
113 disposition(NEW_FOREGROUND_TAB), | 115 disposition(NEW_FOREGROUND_TAB), |
114 trusted_source(false), | 116 trusted_source(false), |
115 transition(a_transition), | 117 transition(a_transition), |
116 is_renderer_initiated(false), | 118 is_renderer_initiated(false), |
117 tabstrip_index(-1), | 119 tabstrip_index(-1), |
118 tabstrip_add_types(TabStripModel::ADD_ACTIVE), | 120 tabstrip_add_types(TabStripModel::ADD_ACTIVE), |
119 window_action(SHOW_WINDOW), | 121 window_action(SHOW_WINDOW), |
120 user_gesture(true), | 122 user_gesture(true), |
121 path_behavior(RESPECT), | 123 path_behavior(RESPECT), |
122 ref_behavior(IGNORE_REF), | 124 ref_behavior(IGNORE_REF), |
123 #if !defined(OS_ANDROID) | 125 #if !defined(OS_ANDROID) || defined(USE_AURA) |
124 browser(NULL), | 126 browser(NULL), |
125 #endif | 127 #endif |
126 initiating_profile(a_profile), | 128 initiating_profile(a_profile), |
127 host_desktop_type(GetActiveDesktop()), | 129 host_desktop_type(GetActiveDesktop()), |
128 should_replace_current_entry(false), | 130 should_replace_current_entry(false), |
129 created_with_opener(false) { | 131 created_with_opener(false) { |
130 } | 132 } |
131 | 133 |
132 NavigateParams::~NavigateParams() {} | 134 NavigateParams::~NavigateParams() {} |
133 | 135 |
134 void FillNavigateParamsFromOpenURLParams(NavigateParams* nav_params, | 136 void FillNavigateParamsFromOpenURLParams(NavigateParams* nav_params, |
135 const content::OpenURLParams& params) { | 137 const content::OpenURLParams& params) { |
136 nav_params->referrer = params.referrer; | 138 nav_params->referrer = params.referrer; |
137 nav_params->source_site_instance = params.source_site_instance; | 139 nav_params->source_site_instance = params.source_site_instance; |
138 nav_params->frame_tree_node_id = params.frame_tree_node_id; | 140 nav_params->frame_tree_node_id = params.frame_tree_node_id; |
139 nav_params->redirect_chain = params.redirect_chain; | 141 nav_params->redirect_chain = params.redirect_chain; |
140 nav_params->extra_headers = params.extra_headers; | 142 nav_params->extra_headers = params.extra_headers; |
141 nav_params->disposition = params.disposition; | 143 nav_params->disposition = params.disposition; |
142 nav_params->trusted_source = false; | 144 nav_params->trusted_source = false; |
143 nav_params->is_renderer_initiated = params.is_renderer_initiated; | 145 nav_params->is_renderer_initiated = params.is_renderer_initiated; |
144 nav_params->transferred_global_request_id = | 146 nav_params->transferred_global_request_id = |
145 params.transferred_global_request_id; | 147 params.transferred_global_request_id; |
146 nav_params->should_replace_current_entry = | 148 nav_params->should_replace_current_entry = |
147 params.should_replace_current_entry; | 149 params.should_replace_current_entry; |
148 nav_params->uses_post = params.uses_post; | 150 nav_params->uses_post = params.uses_post; |
149 nav_params->browser_initiated_post_data = params.browser_initiated_post_data; | 151 nav_params->browser_initiated_post_data = params.browser_initiated_post_data; |
150 } | 152 } |
151 | 153 |
152 } // namespace chrome | 154 } // namespace chrome |
OLD | NEW |