| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "chrome/browser/debugger/devtools_toggle_action.h" | 42 #include "chrome/browser/debugger/devtools_toggle_action.h" |
| 43 #include "chrome/browser/debugger/devtools_window.h" | 43 #include "chrome/browser/debugger/devtools_window.h" |
| 44 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 44 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 45 #include "chrome/browser/download/download_item_model.h" | 45 #include "chrome/browser/download/download_item_model.h" |
| 46 #include "chrome/browser/download/download_service.h" | 46 #include "chrome/browser/download/download_service.h" |
| 47 #include "chrome/browser/download/download_service_factory.h" | 47 #include "chrome/browser/download/download_service_factory.h" |
| 48 #include "chrome/browser/download/download_started_animation.h" | 48 #include "chrome/browser/download/download_started_animation.h" |
| 49 #include "chrome/browser/download/download_util.h" | 49 #include "chrome/browser/download/download_util.h" |
| 50 #include "chrome/browser/extensions/crx_installer.h" | 50 #include "chrome/browser/extensions/crx_installer.h" |
| 51 #include "chrome/browser/extensions/default_apps_trial.h" | 51 #include "chrome/browser/extensions/default_apps_trial.h" |
| 52 #include "chrome/browser/extensions/browser_extension_window_controller.h" |
| 52 #include "chrome/browser/extensions/extension_browser_event_router.h" | 53 #include "chrome/browser/extensions/extension_browser_event_router.h" |
| 53 #include "chrome/browser/extensions/extension_disabled_infobar_delegate.h" | 54 #include "chrome/browser/extensions/extension_disabled_infobar_delegate.h" |
| 54 #include "chrome/browser/extensions/extension_prefs.h" | 55 #include "chrome/browser/extensions/extension_prefs.h" |
| 55 #include "chrome/browser/extensions/extension_service.h" | 56 #include "chrome/browser/extensions/extension_service.h" |
| 56 #include "chrome/browser/extensions/extension_tab_helper.h" | 57 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 57 #include "chrome/browser/extensions/extension_tabs_module.h" | 58 #include "chrome/browser/extensions/extension_tabs_module.h" |
| 58 #include "chrome/browser/favicon/favicon_tab_helper.h" | 59 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 59 #include "chrome/browser/file_select_helper.h" | 60 #include "chrome/browser/file_select_helper.h" |
| 60 #include "chrome/browser/first_run/first_run.h" | 61 #include "chrome/browser/first_run/first_run.h" |
| 61 #include "chrome/browser/google/google_url_tracker.h" | 62 #include "chrome/browser/google/google_url_tracker.h" |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 ShellIntegration::GetAppId(UTF8ToWide(app_name_), profile_->GetPath()) : | 562 ShellIntegration::GetAppId(UTF8ToWide(app_name_), profile_->GetPath()) : |
| 562 ShellIntegration::GetChromiumAppId(profile_->GetPath()), | 563 ShellIntegration::GetChromiumAppId(profile_->GetPath()), |
| 563 window()->GetNativeHandle()); | 564 window()->GetNativeHandle()); |
| 564 | 565 |
| 565 if (is_type_panel()) { | 566 if (is_type_panel()) { |
| 566 ui::win::SetAppIconForWindow(ShellIntegration::GetChromiumIconPath(), | 567 ui::win::SetAppIconForWindow(ShellIntegration::GetChromiumIconPath(), |
| 567 window()->GetNativeHandle()); | 568 window()->GetNativeHandle()); |
| 568 } | 569 } |
| 569 #endif | 570 #endif |
| 570 | 571 |
| 572 // Create the extension window controller before sending notifications. |
| 573 extension_window_controller_.reset( |
| 574 new BrowserExtensionWindowController(this)); |
| 575 |
| 571 content::NotificationService::current()->Notify( | 576 content::NotificationService::current()->Notify( |
| 572 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 577 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
| 573 content::Source<Browser>(this), | 578 content::Source<Browser>(this), |
| 574 content::NotificationService::NoDetails()); | 579 content::NotificationService::NoDetails()); |
| 575 | 580 |
| 576 PrefService* local_state = g_browser_process->local_state(); | 581 PrefService* local_state = g_browser_process->local_state(); |
| 577 if (local_state && local_state->FindPreference( | 582 if (local_state && local_state->FindPreference( |
| 578 prefs::kAutofillPersonalDataManagerFirstRun) && | 583 prefs::kAutofillPersonalDataManagerFirstRun) && |
| 579 local_state->GetBoolean(prefs::kAutofillPersonalDataManagerFirstRun)) { | 584 local_state->GetBoolean(prefs::kAutofillPersonalDataManagerFirstRun)) { |
| 580 // Notify PDM that this is a first run. | 585 // Notify PDM that this is a first run. |
| (...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1835 tab_handler_->GetTabStripModel()->DetachTabContentsAt(active_index()); | 1840 tab_handler_->GetTabStripModel()->DetachTabContentsAt(active_index()); |
| 1836 Browser* browser = Browser::Create(profile_); | 1841 Browser* browser = Browser::Create(profile_); |
| 1837 browser->tabstrip_model()->AppendTabContents(contents, true); | 1842 browser->tabstrip_model()->AppendTabContents(contents, true); |
| 1838 browser->window()->Show(); | 1843 browser->window()->Show(); |
| 1839 } | 1844 } |
| 1840 | 1845 |
| 1841 void Browser::ToggleFullscreenMode() { | 1846 void Browser::ToggleFullscreenMode() { |
| 1842 fullscreen_controller_->ToggleFullscreenMode(); | 1847 fullscreen_controller_->ToggleFullscreenMode(); |
| 1843 } | 1848 } |
| 1844 | 1849 |
| 1845 void Browser::ToggleFullscreenModeWithExtension(const Extension& extension) { | 1850 void Browser::ToggleFullscreenModeWithExtension(const GURL& extension_url) { |
| 1846 fullscreen_controller_->ToggleFullscreenModeWithExtension(extension); | 1851 fullscreen_controller_->ToggleFullscreenModeWithExtension(extension_url); |
| 1847 } | 1852 } |
| 1848 | 1853 |
| 1849 #if defined(OS_MACOSX) | 1854 #if defined(OS_MACOSX) |
| 1850 void Browser::TogglePresentationMode() { | 1855 void Browser::TogglePresentationMode() { |
| 1851 fullscreen_controller_->TogglePresentationMode(); | 1856 fullscreen_controller_->TogglePresentationMode(); |
| 1852 } | 1857 } |
| 1853 #endif | 1858 #endif |
| 1854 | 1859 |
| 1855 #if defined(OS_CHROMEOS) | 1860 #if defined(OS_CHROMEOS) |
| 1856 void Browser::Search() { | 1861 void Browser::Search() { |
| (...skipping 3719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5576 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; | 5581 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; |
| 5577 ShowSingletonTabOverwritingNTP(params); | 5582 ShowSingletonTabOverwritingNTP(params); |
| 5578 } else { | 5583 } else { |
| 5579 service->ShowLoginDialog(); | 5584 service->ShowLoginDialog(); |
| 5580 } | 5585 } |
| 5581 } | 5586 } |
| 5582 | 5587 |
| 5583 void Browser::ToggleSpeechInput() { | 5588 void Browser::ToggleSpeechInput() { |
| 5584 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5589 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
| 5585 } | 5590 } |
| OLD | NEW |