| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 286 |
| 287 NOTREACHED(); | 287 NOTREACHED(); |
| 288 return content::SECURITY_STYLE_UNKNOWN; | 288 return content::SECURITY_STYLE_UNKNOWN; |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace | 291 } // namespace |
| 292 | 292 |
| 293 //////////////////////////////////////////////////////////////////////////////// | 293 //////////////////////////////////////////////////////////////////////////////// |
| 294 // Browser, CreateParams: | 294 // Browser, CreateParams: |
| 295 | 295 |
| 296 Browser::CreateParams::CreateParams(Profile* profile, | 296 Browser::CreateParams::CreateParams(Profile* profile) |
| 297 chrome::HostDesktopType host_desktop_type) | |
| 298 : type(TYPE_TABBED), | 297 : type(TYPE_TABBED), |
| 299 profile(profile), | 298 profile(profile), |
| 300 host_desktop_type(host_desktop_type), | |
| 301 trusted_source(false), | 299 trusted_source(false), |
| 302 initial_show_state(ui::SHOW_STATE_DEFAULT), | 300 initial_show_state(ui::SHOW_STATE_DEFAULT), |
| 303 is_session_restore(false), | 301 is_session_restore(false), |
| 304 window(NULL) { | 302 window(NULL) {} |
| 305 } | |
| 306 | 303 |
| 307 Browser::CreateParams::CreateParams(Type type, | 304 Browser::CreateParams::CreateParams(Type type, Profile* profile) |
| 308 Profile* profile, | |
| 309 chrome::HostDesktopType host_desktop_type) | |
| 310 : type(type), | 305 : type(type), |
| 311 profile(profile), | 306 profile(profile), |
| 312 host_desktop_type(host_desktop_type), | |
| 313 trusted_source(false), | 307 trusted_source(false), |
| 314 initial_show_state(ui::SHOW_STATE_DEFAULT), | 308 initial_show_state(ui::SHOW_STATE_DEFAULT), |
| 315 is_session_restore(false), | 309 is_session_restore(false), |
| 316 window(NULL) { | 310 window(NULL) {} |
| 317 } | |
| 318 | 311 |
| 319 // static | 312 // static |
| 320 Browser::CreateParams Browser::CreateParams::CreateForApp( | 313 Browser::CreateParams Browser::CreateParams::CreateForApp( |
| 321 const std::string& app_name, | 314 const std::string& app_name, |
| 322 bool trusted_source, | 315 bool trusted_source, |
| 323 const gfx::Rect& window_bounds, | 316 const gfx::Rect& window_bounds, |
| 324 Profile* profile, | 317 Profile* profile) { |
| 325 chrome::HostDesktopType host_desktop_type) { | |
| 326 DCHECK(!app_name.empty()); | 318 DCHECK(!app_name.empty()); |
| 327 | 319 |
| 328 CreateParams params(TYPE_POPUP, profile, host_desktop_type); | 320 CreateParams params(TYPE_POPUP, profile); |
| 329 params.app_name = app_name; | 321 params.app_name = app_name; |
| 330 params.trusted_source = trusted_source; | 322 params.trusted_source = trusted_source; |
| 331 params.initial_bounds = window_bounds; | 323 params.initial_bounds = window_bounds; |
| 332 | 324 |
| 333 return params; | 325 return params; |
| 334 } | 326 } |
| 335 | 327 |
| 336 // static | 328 // static |
| 337 Browser::CreateParams Browser::CreateParams::CreateForDevTools( | 329 Browser::CreateParams Browser::CreateParams::CreateForDevTools( |
| 338 Profile* profile, | 330 Profile* profile) { |
| 339 chrome::HostDesktopType host_desktop_type) { | 331 CreateParams params(TYPE_POPUP, profile); |
| 340 CreateParams params(TYPE_POPUP, profile, host_desktop_type); | |
| 341 params.app_name = DevToolsWindow::kDevToolsApp; | 332 params.app_name = DevToolsWindow::kDevToolsApp; |
| 342 params.trusted_source = true; | 333 params.trusted_source = true; |
| 343 return params; | 334 return params; |
| 344 } | 335 } |
| 345 | 336 |
| 346 //////////////////////////////////////////////////////////////////////////////// | 337 //////////////////////////////////////////////////////////////////////////////// |
| 347 // Browser, InterstitialObserver: | 338 // Browser, InterstitialObserver: |
| 348 | 339 |
| 349 class Browser::InterstitialObserver : public content::WebContentsObserver { | 340 class Browser::InterstitialObserver : public content::WebContentsObserver { |
| 350 public: | 341 public: |
| (...skipping 26 matching lines...) Expand all Loading... |
| 377 window_(NULL), | 368 window_(NULL), |
| 378 tab_strip_model_delegate_(new chrome::BrowserTabStripModelDelegate(this)), | 369 tab_strip_model_delegate_(new chrome::BrowserTabStripModelDelegate(this)), |
| 379 tab_strip_model_( | 370 tab_strip_model_( |
| 380 new TabStripModel(tab_strip_model_delegate_.get(), params.profile)), | 371 new TabStripModel(tab_strip_model_delegate_.get(), params.profile)), |
| 381 app_name_(params.app_name), | 372 app_name_(params.app_name), |
| 382 is_trusted_source_(params.trusted_source), | 373 is_trusted_source_(params.trusted_source), |
| 383 cancel_download_confirmation_state_(NOT_PROMPTED), | 374 cancel_download_confirmation_state_(NOT_PROMPTED), |
| 384 override_bounds_(params.initial_bounds), | 375 override_bounds_(params.initial_bounds), |
| 385 initial_show_state_(params.initial_show_state), | 376 initial_show_state_(params.initial_show_state), |
| 386 is_session_restore_(params.is_session_restore), | 377 is_session_restore_(params.is_session_restore), |
| 387 host_desktop_type_(params.host_desktop_type), | 378 host_desktop_type_(chrome::HOST_DESKTOP_TYPE_NATIVE), |
| 388 content_setting_bubble_model_delegate_( | 379 content_setting_bubble_model_delegate_( |
| 389 new BrowserContentSettingBubbleModelDelegate(this)), | 380 new BrowserContentSettingBubbleModelDelegate(this)), |
| 390 toolbar_model_delegate_(new BrowserToolbarModelDelegate(this)), | 381 toolbar_model_delegate_(new BrowserToolbarModelDelegate(this)), |
| 391 live_tab_context_(new BrowserLiveTabContext(this)), | 382 live_tab_context_(new BrowserLiveTabContext(this)), |
| 392 synced_window_delegate_(new BrowserSyncedWindowDelegate(this)), | 383 synced_window_delegate_(new BrowserSyncedWindowDelegate(this)), |
| 393 bookmark_bar_state_(BookmarkBar::HIDDEN), | 384 bookmark_bar_state_(BookmarkBar::HIDDEN), |
| 394 command_controller_(new chrome::BrowserCommandController(this)), | 385 command_controller_(new chrome::BrowserCommandController(this)), |
| 395 window_has_shown_(false), | 386 window_has_shown_(false), |
| 396 chrome_updater_factory_(this), | 387 chrome_updater_factory_(this), |
| 397 weak_factory_(this) { | 388 weak_factory_(this) { |
| (...skipping 2341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2739 if (contents && !allow_js_access) { | 2730 if (contents && !allow_js_access) { |
| 2740 contents->web_contents()->GetController().LoadURL( | 2731 contents->web_contents()->GetController().LoadURL( |
| 2741 target_url, | 2732 target_url, |
| 2742 content::Referrer(), | 2733 content::Referrer(), |
| 2743 ui::PAGE_TRANSITION_LINK, | 2734 ui::PAGE_TRANSITION_LINK, |
| 2744 std::string()); // No extra headers. | 2735 std::string()); // No extra headers. |
| 2745 } | 2736 } |
| 2746 | 2737 |
| 2747 return contents != NULL; | 2738 return contents != NULL; |
| 2748 } | 2739 } |
| OLD | NEW |