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 #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 // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "chrome/browser/google/google_url_tracker.h" | 59 #include "chrome/browser/google/google_url_tracker.h" |
60 #include "chrome/browser/history/top_sites.h" | 60 #include "chrome/browser/history/top_sites.h" |
61 #include "chrome/browser/infobars/infobar_service.h" | 61 #include "chrome/browser/infobars/infobar_service.h" |
62 #include "chrome/browser/infobars/simple_alert_infobar_delegate.h" | 62 #include "chrome/browser/infobars/simple_alert_infobar_delegate.h" |
63 #include "chrome/browser/lifetime/application_lifetime.h" | 63 #include "chrome/browser/lifetime/application_lifetime.h" |
64 #include "chrome/browser/notifications/notification_ui_manager.h" | 64 #include "chrome/browser/notifications/notification_ui_manager.h" |
65 #include "chrome/browser/pepper_broker_infobar_delegate.h" | 65 #include "chrome/browser/pepper_broker_infobar_delegate.h" |
66 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 66 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
67 #include "chrome/browser/profiles/profile.h" | 67 #include "chrome/browser/profiles/profile.h" |
68 #include "chrome/browser/profiles/profile_destroyer.h" | 68 #include "chrome/browser/profiles/profile_destroyer.h" |
69 #include "chrome/browser/profiles/profile_manager.h" | |
70 #include "chrome/browser/profiles/profile_metrics.h" | 69 #include "chrome/browser/profiles/profile_metrics.h" |
71 #include "chrome/browser/repost_form_warning_controller.h" | 70 #include "chrome/browser/repost_form_warning_controller.h" |
72 #include "chrome/browser/search/search.h" | 71 #include "chrome/browser/search/search.h" |
73 #include "chrome/browser/sessions/session_service.h" | 72 #include "chrome/browser/sessions/session_service.h" |
74 #include "chrome/browser/sessions/session_service_factory.h" | 73 #include "chrome/browser/sessions/session_service_factory.h" |
75 #include "chrome/browser/sessions/session_tab_helper.h" | 74 #include "chrome/browser/sessions/session_tab_helper.h" |
76 #include "chrome/browser/sessions/session_types.h" | 75 #include "chrome/browser/sessions/session_types.h" |
77 #include "chrome/browser/sessions/tab_restore_service.h" | 76 #include "chrome/browser/sessions/tab_restore_service.h" |
78 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 77 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
79 #include "chrome/browser/sync/profile_sync_service.h" | 78 #include "chrome/browser/sync/profile_sync_service.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 initial_show_state_(params.initial_show_state), | 339 initial_show_state_(params.initial_show_state), |
341 is_session_restore_(params.is_session_restore), | 340 is_session_restore_(params.is_session_restore), |
342 host_desktop_type_(BrowserWindow::AdjustHostDesktopType( | 341 host_desktop_type_(BrowserWindow::AdjustHostDesktopType( |
343 params.host_desktop_type)), | 342 params.host_desktop_type)), |
344 content_setting_bubble_model_delegate_( | 343 content_setting_bubble_model_delegate_( |
345 new BrowserContentSettingBubbleModelDelegate(this)), | 344 new BrowserContentSettingBubbleModelDelegate(this)), |
346 toolbar_model_delegate_(new BrowserToolbarModelDelegate(this)), | 345 toolbar_model_delegate_(new BrowserToolbarModelDelegate(this)), |
347 tab_restore_service_delegate_(new BrowserTabRestoreServiceDelegate(this)), | 346 tab_restore_service_delegate_(new BrowserTabRestoreServiceDelegate(this)), |
348 synced_window_delegate_(new BrowserSyncedWindowDelegate(this)), | 347 synced_window_delegate_(new BrowserSyncedWindowDelegate(this)), |
349 bookmark_bar_state_(BookmarkBar::HIDDEN), | 348 bookmark_bar_state_(BookmarkBar::HIDDEN), |
350 command_controller_(new chrome::BrowserCommandController( | 349 command_controller_(new chrome::BrowserCommandController(this)), |
351 this, g_browser_process->profile_manager())), | |
352 window_has_shown_(false), | 350 window_has_shown_(false), |
353 chrome_updater_factory_(this), | 351 chrome_updater_factory_(this), |
354 weak_factory_(this), | 352 weak_factory_(this), |
355 translate_driver_observer_( | 353 translate_driver_observer_( |
356 new BrowserContentTranslateDriverObserver(this)) { | 354 new BrowserContentTranslateDriverObserver(this)) { |
357 // If this causes a crash then a window is being opened using a profile type | 355 // If this causes a crash then a window is being opened using a profile type |
358 // that is disallowed by policy. The crash prevents the disabled window type | 356 // that is disallowed by policy. The crash prevents the disabled window type |
359 // from opening at all, but the path that triggered it should be fixed. | 357 // from opening at all, but the path that triggered it should be fixed. |
360 CHECK(IncognitoModePrefs::CanOpenBrowser(profile_)); | 358 CHECK(IncognitoModePrefs::CanOpenBrowser(profile_)); |
361 CHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord()) | 359 CHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord()) |
(...skipping 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2416 if (contents && !allow_js_access) { | 2414 if (contents && !allow_js_access) { |
2417 contents->web_contents()->GetController().LoadURL( | 2415 contents->web_contents()->GetController().LoadURL( |
2418 target_url, | 2416 target_url, |
2419 content::Referrer(), | 2417 content::Referrer(), |
2420 content::PAGE_TRANSITION_LINK, | 2418 content::PAGE_TRANSITION_LINK, |
2421 std::string()); // No extra headers. | 2419 std::string()); // No extra headers. |
2422 } | 2420 } |
2423 | 2421 |
2424 return contents != NULL; | 2422 return contents != NULL; |
2425 } | 2423 } |
OLD | NEW |