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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 ShellIntegration::GetAppId(UTF8ToWide(app_name_), profile_->GetPath()) : | 570 ShellIntegration::GetAppId(UTF8ToWide(app_name_), profile_->GetPath()) : |
570 ShellIntegration::GetChromiumAppId(profile_->GetPath()), | 571 ShellIntegration::GetChromiumAppId(profile_->GetPath()), |
571 window()->GetNativeHandle()); | 572 window()->GetNativeHandle()); |
572 | 573 |
573 if (is_type_panel()) { | 574 if (is_type_panel()) { |
574 ui::win::SetAppIconForWindow(ShellIntegration::GetChromiumIconPath(), | 575 ui::win::SetAppIconForWindow(ShellIntegration::GetChromiumIconPath(), |
575 window()->GetNativeHandle()); | 576 window()->GetNativeHandle()); |
576 } | 577 } |
577 #endif | 578 #endif |
578 | 579 |
| 580 // Create the extension window controller before sending notifications. |
| 581 extension_window_controller_.reset( |
| 582 new BrowserExtensionWindowController(this)); |
| 583 |
579 content::NotificationService::current()->Notify( | 584 content::NotificationService::current()->Notify( |
580 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 585 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
581 content::Source<Browser>(this), | 586 content::Source<Browser>(this), |
582 content::NotificationService::NoDetails()); | 587 content::NotificationService::NoDetails()); |
583 | 588 |
584 PrefService* local_state = g_browser_process->local_state(); | 589 PrefService* local_state = g_browser_process->local_state(); |
585 if (local_state && local_state->FindPreference( | 590 if (local_state && local_state->FindPreference( |
586 prefs::kAutofillPersonalDataManagerFirstRun) && | 591 prefs::kAutofillPersonalDataManagerFirstRun) && |
587 local_state->GetBoolean(prefs::kAutofillPersonalDataManagerFirstRun)) { | 592 local_state->GetBoolean(prefs::kAutofillPersonalDataManagerFirstRun)) { |
588 // Notify PDM that this is a first run. | 593 // Notify PDM that this is a first run. |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1868 tab_handler_->GetTabStripModel()->DetachTabContentsAt(active_index()); | 1873 tab_handler_->GetTabStripModel()->DetachTabContentsAt(active_index()); |
1869 Browser* browser = Browser::Create(profile_); | 1874 Browser* browser = Browser::Create(profile_); |
1870 browser->tabstrip_model()->AppendTabContents(contents, true); | 1875 browser->tabstrip_model()->AppendTabContents(contents, true); |
1871 browser->window()->Show(); | 1876 browser->window()->Show(); |
1872 } | 1877 } |
1873 | 1878 |
1874 void Browser::ToggleFullscreenMode() { | 1879 void Browser::ToggleFullscreenMode() { |
1875 fullscreen_controller_->ToggleFullscreenMode(); | 1880 fullscreen_controller_->ToggleFullscreenMode(); |
1876 } | 1881 } |
1877 | 1882 |
1878 void Browser::ToggleFullscreenModeWithExtension(const Extension& extension) { | 1883 void Browser::ToggleFullscreenModeWithExtension(const GURL& extension_url) { |
1879 fullscreen_controller_->ToggleFullscreenModeWithExtension(extension); | 1884 fullscreen_controller_->ToggleFullscreenModeWithExtension(extension_url); |
1880 } | 1885 } |
1881 | 1886 |
1882 #if defined(OS_MACOSX) | 1887 #if defined(OS_MACOSX) |
1883 void Browser::TogglePresentationMode() { | 1888 void Browser::TogglePresentationMode() { |
1884 fullscreen_controller_->TogglePresentationMode(); | 1889 fullscreen_controller_->TogglePresentationMode(); |
1885 } | 1890 } |
1886 #endif | 1891 #endif |
1887 | 1892 |
1888 #if defined(OS_CHROMEOS) | 1893 #if defined(OS_CHROMEOS) |
1889 void Browser::Search() { | 1894 void Browser::Search() { |
(...skipping 3718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5608 ShowSingletonTabOverwritingNTP(params); | 5613 ShowSingletonTabOverwritingNTP(params); |
5609 } else { | 5614 } else { |
5610 LoginUIServiceFactory::GetForProfile( | 5615 LoginUIServiceFactory::GetForProfile( |
5611 profile()->GetOriginalProfile())->ShowLoginUI(); | 5616 profile()->GetOriginalProfile())->ShowLoginUI(); |
5612 } | 5617 } |
5613 } | 5618 } |
5614 | 5619 |
5615 void Browser::ToggleSpeechInput() { | 5620 void Browser::ToggleSpeechInput() { |
5616 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5621 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
5617 } | 5622 } |
OLD | NEW |