Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: chrome/browser/ui/browser_navigator_params.cc

Issue 1779793003: Remove host_desktop_type() from browser.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-43
Patch Set: cros Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/browser_navigator_params.h ('k') | chrome/browser/ui/chrome_pages.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" 8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "content/public/browser/navigation_controller.h" 9 #include "content/public/browser/navigation_controller.h"
10 #include "content/public/browser/page_navigator.h" 10 #include "content/public/browser/page_navigator.h"
11 11
12 #if !defined(OS_ANDROID) 12 #if !defined(OS_ANDROID)
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/host_desktop.h"
15 #endif 14 #endif
16 15
17 using content::GlobalRequestID; 16 using content::GlobalRequestID;
18 using content::NavigationController; 17 using content::NavigationController;
19 using content::WebContents; 18 using content::WebContents;
20 19
21 namespace chrome { 20 namespace chrome {
22 21
23 #if !defined(OS_ANDROID)
24 namespace {
25
26 HostDesktopType GetHostDesktop(Browser* browser) {
27 if (browser)
28 return browser->host_desktop_type();
29 return GetActiveDesktop();
30 }
31
32 } // namespace
33 #endif
34
35 #if defined(OS_ANDROID) 22 #if defined(OS_ANDROID)
36 NavigateParams::NavigateParams(WebContents* a_target_contents) 23 NavigateParams::NavigateParams(WebContents* a_target_contents)
37 : frame_tree_node_id(-1), 24 : frame_tree_node_id(-1),
38 uses_post(false), 25 uses_post(false),
39 target_contents(a_target_contents), 26 target_contents(a_target_contents),
40 source_contents(nullptr), 27 source_contents(nullptr),
41 disposition(CURRENT_TAB), 28 disposition(CURRENT_TAB),
42 trusted_source(false), 29 trusted_source(false),
43 transition(ui::PAGE_TRANSITION_LINK), 30 transition(ui::PAGE_TRANSITION_LINK),
44 is_renderer_initiated(false), 31 is_renderer_initiated(false),
45 tabstrip_index(-1), 32 tabstrip_index(-1),
46 tabstrip_add_types(TabStripModel::ADD_ACTIVE), 33 tabstrip_add_types(TabStripModel::ADD_ACTIVE),
47 window_action(NO_ACTION), 34 window_action(NO_ACTION),
48 user_gesture(true), 35 user_gesture(true),
49 path_behavior(RESPECT), 36 path_behavior(RESPECT),
50 ref_behavior(IGNORE_REF), 37 ref_behavior(IGNORE_REF),
51 initiating_profile(nullptr), 38 initiating_profile(nullptr),
52 host_desktop_type(GetActiveDesktop()),
53 should_replace_current_entry(false), 39 should_replace_current_entry(false),
54 created_with_opener(false) { 40 created_with_opener(false) {
55 } 41 }
56 #else 42 #else
57 NavigateParams::NavigateParams(Browser* a_browser, 43 NavigateParams::NavigateParams(Browser* a_browser,
58 const GURL& a_url, 44 const GURL& a_url,
59 ui::PageTransition a_transition) 45 ui::PageTransition a_transition)
60 : url(a_url), 46 : url(a_url),
61 frame_tree_node_id(-1), 47 frame_tree_node_id(-1),
62 uses_post(false), 48 uses_post(false),
63 target_contents(NULL), 49 target_contents(NULL),
64 source_contents(NULL), 50 source_contents(NULL),
65 disposition(CURRENT_TAB), 51 disposition(CURRENT_TAB),
66 trusted_source(false), 52 trusted_source(false),
67 transition(a_transition), 53 transition(a_transition),
68 is_renderer_initiated(false), 54 is_renderer_initiated(false),
69 tabstrip_index(-1), 55 tabstrip_index(-1),
70 tabstrip_add_types(TabStripModel::ADD_ACTIVE), 56 tabstrip_add_types(TabStripModel::ADD_ACTIVE),
71 window_action(NO_ACTION), 57 window_action(NO_ACTION),
72 user_gesture(true), 58 user_gesture(true),
73 path_behavior(RESPECT), 59 path_behavior(RESPECT),
74 ref_behavior(IGNORE_REF), 60 ref_behavior(IGNORE_REF),
75 browser(a_browser), 61 browser(a_browser),
76 initiating_profile(NULL), 62 initiating_profile(NULL),
77 host_desktop_type(GetHostDesktop(a_browser)),
78 should_replace_current_entry(false), 63 should_replace_current_entry(false),
79 created_with_opener(false) { 64 created_with_opener(false) {
80 } 65 }
81 66
82 NavigateParams::NavigateParams(Browser* a_browser, 67 NavigateParams::NavigateParams(Browser* a_browser,
83 WebContents* a_target_contents) 68 WebContents* a_target_contents)
84 : frame_tree_node_id(-1), 69 : frame_tree_node_id(-1),
85 uses_post(false), 70 uses_post(false),
86 target_contents(a_target_contents), 71 target_contents(a_target_contents),
87 source_contents(NULL), 72 source_contents(NULL),
88 disposition(CURRENT_TAB), 73 disposition(CURRENT_TAB),
89 trusted_source(false), 74 trusted_source(false),
90 transition(ui::PAGE_TRANSITION_LINK), 75 transition(ui::PAGE_TRANSITION_LINK),
91 is_renderer_initiated(false), 76 is_renderer_initiated(false),
92 tabstrip_index(-1), 77 tabstrip_index(-1),
93 tabstrip_add_types(TabStripModel::ADD_ACTIVE), 78 tabstrip_add_types(TabStripModel::ADD_ACTIVE),
94 window_action(NO_ACTION), 79 window_action(NO_ACTION),
95 user_gesture(true), 80 user_gesture(true),
96 path_behavior(RESPECT), 81 path_behavior(RESPECT),
97 ref_behavior(IGNORE_REF), 82 ref_behavior(IGNORE_REF),
98 browser(a_browser), 83 browser(a_browser),
99 initiating_profile(NULL), 84 initiating_profile(NULL),
100 host_desktop_type(GetHostDesktop(a_browser)),
101 should_replace_current_entry(false), 85 should_replace_current_entry(false),
102 created_with_opener(false) { 86 created_with_opener(false) {
103 } 87 }
104 #endif // !defined(OS_ANDROID) 88 #endif // !defined(OS_ANDROID)
105 89
106 NavigateParams::NavigateParams(Profile* a_profile, 90 NavigateParams::NavigateParams(Profile* a_profile,
107 const GURL& a_url, 91 const GURL& a_url,
108 ui::PageTransition a_transition) 92 ui::PageTransition a_transition)
109 : url(a_url), 93 : url(a_url),
110 frame_tree_node_id(-1), 94 frame_tree_node_id(-1),
111 uses_post(false), 95 uses_post(false),
112 target_contents(NULL), 96 target_contents(NULL),
113 source_contents(NULL), 97 source_contents(NULL),
114 disposition(NEW_FOREGROUND_TAB), 98 disposition(NEW_FOREGROUND_TAB),
115 trusted_source(false), 99 trusted_source(false),
116 transition(a_transition), 100 transition(a_transition),
117 is_renderer_initiated(false), 101 is_renderer_initiated(false),
118 tabstrip_index(-1), 102 tabstrip_index(-1),
119 tabstrip_add_types(TabStripModel::ADD_ACTIVE), 103 tabstrip_add_types(TabStripModel::ADD_ACTIVE),
120 window_action(SHOW_WINDOW), 104 window_action(SHOW_WINDOW),
121 user_gesture(true), 105 user_gesture(true),
122 path_behavior(RESPECT), 106 path_behavior(RESPECT),
123 ref_behavior(IGNORE_REF), 107 ref_behavior(IGNORE_REF),
124 #if !defined(OS_ANDROID) 108 #if !defined(OS_ANDROID)
125 browser(NULL), 109 browser(NULL),
126 #endif 110 #endif
127 initiating_profile(a_profile), 111 initiating_profile(a_profile),
128 host_desktop_type(GetActiveDesktop()),
129 should_replace_current_entry(false), 112 should_replace_current_entry(false),
130 created_with_opener(false) { 113 created_with_opener(false) {
131 } 114 }
132 115
133 NavigateParams::NavigateParams(const NavigateParams& other) = default; 116 NavigateParams::NavigateParams(const NavigateParams& other) = default;
134 117
135 NavigateParams::~NavigateParams() {} 118 NavigateParams::~NavigateParams() {}
136 119
137 void FillNavigateParamsFromOpenURLParams(NavigateParams* nav_params, 120 void FillNavigateParamsFromOpenURLParams(NavigateParams* nav_params,
138 const content::OpenURLParams& params) { 121 const content::OpenURLParams& params) {
139 nav_params->referrer = params.referrer; 122 nav_params->referrer = params.referrer;
140 nav_params->source_site_instance = params.source_site_instance; 123 nav_params->source_site_instance = params.source_site_instance;
141 nav_params->frame_tree_node_id = params.frame_tree_node_id; 124 nav_params->frame_tree_node_id = params.frame_tree_node_id;
142 nav_params->redirect_chain = params.redirect_chain; 125 nav_params->redirect_chain = params.redirect_chain;
143 nav_params->extra_headers = params.extra_headers; 126 nav_params->extra_headers = params.extra_headers;
144 nav_params->disposition = params.disposition; 127 nav_params->disposition = params.disposition;
145 nav_params->trusted_source = false; 128 nav_params->trusted_source = false;
146 nav_params->is_renderer_initiated = params.is_renderer_initiated; 129 nav_params->is_renderer_initiated = params.is_renderer_initiated;
147 nav_params->should_replace_current_entry = 130 nav_params->should_replace_current_entry =
148 params.should_replace_current_entry; 131 params.should_replace_current_entry;
149 nav_params->uses_post = params.uses_post; 132 nav_params->uses_post = params.uses_post;
150 nav_params->browser_initiated_post_data = params.browser_initiated_post_data; 133 nav_params->browser_initiated_post_data = params.browser_initiated_post_data;
151 } 134 }
152 135
153 } // namespace chrome 136 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_navigator_params.h ('k') | chrome/browser/ui/chrome_pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698