OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 } | 248 } |
249 | 249 |
250 BrowserWindow* CreateBrowserWindow(Browser* browser) { | 250 BrowserWindow* CreateBrowserWindow(Browser* browser) { |
251 #if !defined(USE_ASH) | 251 #if !defined(USE_ASH) |
252 if (browser->is_type_panel()) | 252 if (browser->is_type_panel()) |
253 return PanelManager::GetInstance()->CreatePanel(browser)->browser_window(); | 253 return PanelManager::GetInstance()->CreatePanel(browser)->browser_window(); |
254 #endif | 254 #endif |
255 return BrowserWindow::CreateBrowserWindow(browser); | 255 return BrowserWindow::CreateBrowserWindow(browser); |
256 } | 256 } |
257 | 257 |
| 258 #if defined(OS_CHROMEOS) |
| 259 chrome::HostDesktopType kDefaultHostDesktopType = chrome::HOST_DESKTOP_TYPE_ASH; |
| 260 #else |
| 261 chrome::HostDesktopType kDefaultHostDesktopType = |
| 262 chrome::HOST_DESKTOP_TYPE_NATIVE; |
| 263 #endif |
| 264 |
| 265 |
258 } // namespace | 266 } // namespace |
259 | 267 |
260 //////////////////////////////////////////////////////////////////////////////// | 268 //////////////////////////////////////////////////////////////////////////////// |
261 // Browser, CreateParams: | 269 // Browser, CreateParams: |
262 | 270 |
263 Browser::CreateParams::CreateParams() | 271 Browser::CreateParams::CreateParams() |
264 : type(TYPE_TABBED), | 272 : type(TYPE_TABBED), |
265 profile(NULL), | 273 profile(NULL), |
| 274 host_desktop_type(kDefaultHostDesktopType), |
266 app_type(APP_TYPE_HOST), | 275 app_type(APP_TYPE_HOST), |
267 initial_show_state(ui::SHOW_STATE_DEFAULT), | 276 initial_show_state(ui::SHOW_STATE_DEFAULT), |
268 is_session_restore(false), | 277 is_session_restore(false), |
269 window(NULL) { | 278 window(NULL) { |
270 } | 279 } |
271 | 280 |
272 Browser::CreateParams::CreateParams(Profile* profile) | 281 Browser::CreateParams::CreateParams(Profile* profile) |
273 : type(TYPE_TABBED), | 282 : type(TYPE_TABBED), |
274 profile(profile), | 283 profile(profile), |
275 app_type(APP_TYPE_HOST), | 284 host_desktop_type(kDefaultHostDesktopType), |
276 initial_show_state(ui::SHOW_STATE_DEFAULT), | 285 app_type(APP_TYPE_HOST), |
277 is_session_restore(false), | 286 initial_show_state(ui::SHOW_STATE_DEFAULT), |
278 window(NULL) { | 287 is_session_restore(false), |
| 288 window(NULL) { |
279 } | 289 } |
280 | 290 |
281 Browser::CreateParams::CreateParams(Type type, Profile* profile) | 291 Browser::CreateParams::CreateParams(Type type, Profile* profile) |
282 : type(type), | 292 : type(type), |
283 profile(profile), | 293 profile(profile), |
| 294 host_desktop_type(kDefaultHostDesktopType), |
284 app_type(APP_TYPE_HOST), | 295 app_type(APP_TYPE_HOST), |
285 initial_show_state(ui::SHOW_STATE_DEFAULT), | 296 initial_show_state(ui::SHOW_STATE_DEFAULT), |
286 is_session_restore(false), | 297 is_session_restore(false), |
| 298 window(NULL) { |
| 299 } |
| 300 |
| 301 Browser::CreateParams::CreateParams(Type type, |
| 302 Profile* profile, |
| 303 chrome::HostDesktopType host_desktop_type) |
| 304 : type(type), |
| 305 profile(profile), |
| 306 host_desktop_type(host_desktop_type), |
| 307 app_type(APP_TYPE_HOST), |
| 308 initial_show_state(ui::SHOW_STATE_DEFAULT), |
| 309 is_session_restore(false), |
287 window(NULL) { | 310 window(NULL) { |
288 } | 311 } |
289 | 312 |
290 // static | 313 // static |
291 Browser::CreateParams Browser::CreateParams::CreateForApp( | 314 Browser::CreateParams Browser::CreateParams::CreateForApp( |
292 Type type, | 315 Type type, |
293 const std::string& app_name, | 316 const std::string& app_name, |
294 const gfx::Rect& window_bounds, | 317 const gfx::Rect& window_bounds, |
295 Profile* profile) { | 318 Profile* profile) { |
296 DCHECK(type != TYPE_TABBED); | 319 DCHECK(type != TYPE_TABBED); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 ALLOW_THIS_IN_INITIALIZER_LIST( | 351 ALLOW_THIS_IN_INITIALIZER_LIST( |
329 tab_strip_model_(new TabStripModel(tab_strip_model_delegate_.get(), | 352 tab_strip_model_(new TabStripModel(tab_strip_model_delegate_.get(), |
330 params.profile))), | 353 params.profile))), |
331 app_name_(params.app_name), | 354 app_name_(params.app_name), |
332 app_type_(params.app_type), | 355 app_type_(params.app_type), |
333 chrome_updater_factory_(this), | 356 chrome_updater_factory_(this), |
334 cancel_download_confirmation_state_(NOT_PROMPTED), | 357 cancel_download_confirmation_state_(NOT_PROMPTED), |
335 override_bounds_(params.initial_bounds), | 358 override_bounds_(params.initial_bounds), |
336 initial_show_state_(params.initial_show_state), | 359 initial_show_state_(params.initial_show_state), |
337 is_session_restore_(params.is_session_restore), | 360 is_session_restore_(params.is_session_restore), |
| 361 host_desktop_type_(params.host_desktop_type), |
338 ALLOW_THIS_IN_INITIALIZER_LIST( | 362 ALLOW_THIS_IN_INITIALIZER_LIST( |
339 unload_controller_(new chrome::UnloadController(this))), | 363 unload_controller_(new chrome::UnloadController(this))), |
340 weak_factory_(this), | 364 weak_factory_(this), |
341 ALLOW_THIS_IN_INITIALIZER_LIST( | 365 ALLOW_THIS_IN_INITIALIZER_LIST( |
342 content_setting_bubble_model_delegate_( | 366 content_setting_bubble_model_delegate_( |
343 new BrowserContentSettingBubbleModelDelegate(this))), | 367 new BrowserContentSettingBubbleModelDelegate(this))), |
344 ALLOW_THIS_IN_INITIALIZER_LIST( | 368 ALLOW_THIS_IN_INITIALIZER_LIST( |
345 toolbar_model_delegate_( | 369 toolbar_model_delegate_( |
346 new BrowserToolbarModelDelegate(this))), | 370 new BrowserToolbarModelDelegate(this))), |
347 ALLOW_THIS_IN_INITIALIZER_LIST( | 371 ALLOW_THIS_IN_INITIALIZER_LIST( |
(...skipping 1947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2295 if (contents && !allow_js_access) { | 2319 if (contents && !allow_js_access) { |
2296 contents->web_contents()->GetController().LoadURL( | 2320 contents->web_contents()->GetController().LoadURL( |
2297 target_url, | 2321 target_url, |
2298 content::Referrer(), | 2322 content::Referrer(), |
2299 content::PAGE_TRANSITION_LINK, | 2323 content::PAGE_TRANSITION_LINK, |
2300 std::string()); // No extra headers. | 2324 std::string()); // No extra headers. |
2301 } | 2325 } |
2302 | 2326 |
2303 return contents != NULL; | 2327 return contents != NULL; |
2304 } | 2328 } |
OLD | NEW |