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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, | 363 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, |
364 content::Source<Profile>(profile_->GetOriginalProfile())); | 364 content::Source<Profile>(profile_->GetOriginalProfile())); |
365 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 365 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
366 content::Source<Profile>(profile_->GetOriginalProfile())); | 366 content::Source<Profile>(profile_->GetOriginalProfile())); |
367 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 367 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
368 content::Source<Profile>(profile_->GetOriginalProfile())); | 368 content::Source<Profile>(profile_->GetOriginalProfile())); |
369 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, | 369 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
370 content::Source<Profile>(profile_->GetOriginalProfile())); | 370 content::Source<Profile>(profile_->GetOriginalProfile())); |
371 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 371 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
372 content::NotificationService::AllSources()); | 372 content::NotificationService::AllSources()); |
| 373 #if defined(ENABLE_THEMES) |
373 registrar_.Add( | 374 registrar_.Add( |
374 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 375 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
375 content::Source<ThemeService>( | 376 content::Source<ThemeService>( |
376 ThemeServiceFactory::GetForProfile(profile_))); | 377 ThemeServiceFactory::GetForProfile(profile_))); |
| 378 #endif |
377 registrar_.Add(this, chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, | 379 registrar_.Add(this, chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, |
378 content::NotificationService::AllSources()); | 380 content::NotificationService::AllSources()); |
379 | 381 |
380 PrefService* local_state = g_browser_process->local_state(); | 382 PrefService* local_state = g_browser_process->local_state(); |
381 if (local_state) { | 383 if (local_state) { |
382 local_pref_registrar_.Init(local_state); | 384 local_pref_registrar_.Init(local_state); |
383 local_pref_registrar_.Add(prefs::kPrintingEnabled, this); | 385 local_pref_registrar_.Add(prefs::kPrintingEnabled, this); |
384 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this); | 386 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this); |
385 local_pref_registrar_.Add(prefs::kMetricsReportingEnabled, this); | 387 local_pref_registrar_.Add(prefs::kMetricsReportingEnabled, this); |
386 } | 388 } |
(...skipping 4013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4400 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: | 4402 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: |
4401 case chrome::NOTIFICATION_EXTENSION_LOADED: | 4403 case chrome::NOTIFICATION_EXTENSION_LOADED: |
4402 // During window creation on Windows we may end up calling into | 4404 // During window creation on Windows we may end up calling into |
4403 // SHAppBarMessage, which internally spawns a nested message loop. This | 4405 // SHAppBarMessage, which internally spawns a nested message loop. This |
4404 // makes it possible for us to end up here before window creation has | 4406 // makes it possible for us to end up here before window creation has |
4405 // completed,at which point window_ is NULL. See 94752 for details. | 4407 // completed,at which point window_ is NULL. See 94752 for details. |
4406 if (window() && window()->GetLocationBar()) | 4408 if (window() && window()->GetLocationBar()) |
4407 window()->GetLocationBar()->UpdatePageActions(); | 4409 window()->GetLocationBar()->UpdatePageActions(); |
4408 break; | 4410 break; |
4409 | 4411 |
| 4412 #if defined(ENABLE_THEMES) |
4410 case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: | 4413 case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: |
4411 window()->UserChangedTheme(); | 4414 window()->UserChangedTheme(); |
4412 break; | 4415 break; |
| 4416 #endif |
4413 | 4417 |
4414 case chrome::NOTIFICATION_PREF_CHANGED: { | 4418 case chrome::NOTIFICATION_PREF_CHANGED: { |
4415 const std::string& pref_name = | 4419 const std::string& pref_name = |
4416 *content::Details<std::string>(details).ptr(); | 4420 *content::Details<std::string>(details).ptr(); |
4417 if (pref_name == prefs::kPrintingEnabled) { | 4421 if (pref_name == prefs::kPrintingEnabled) { |
4418 UpdatePrintingState(GetContentRestrictionsForSelectedTab()); | 4422 UpdatePrintingState(GetContentRestrictionsForSelectedTab()); |
4419 } else if (pref_name == prefs::kInstantEnabled || | 4423 } else if (pref_name == prefs::kInstantEnabled || |
4420 pref_name == prefs::kMetricsReportingEnabled || | 4424 pref_name == prefs::kMetricsReportingEnabled || |
4421 pref_name == prefs::kSearchSuggestEnabled) { | 4425 pref_name == prefs::kSearchSuggestEnabled) { |
4422 if (!InstantController::IsEnabled(profile())) { | 4426 if (!InstantController::IsEnabled(profile())) { |
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5622 } else { | 5626 } else { |
5623 LoginUIServiceFactory::GetForProfile( | 5627 LoginUIServiceFactory::GetForProfile( |
5624 profile()->GetOriginalProfile())->ShowLoginUI(); | 5628 profile()->GetOriginalProfile())->ShowLoginUI(); |
5625 } | 5629 } |
5626 #endif | 5630 #endif |
5627 } | 5631 } |
5628 | 5632 |
5629 void Browser::ToggleSpeechInput() { | 5633 void Browser::ToggleSpeechInput() { |
5630 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5634 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
5631 } | 5635 } |
OLD | NEW |