Chromium Code Reviews| 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 365 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, | 365 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, |
| 366 content::Source<Profile>(profile_->GetOriginalProfile())); | 366 content::Source<Profile>(profile_->GetOriginalProfile())); |
| 367 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 367 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
| 368 content::Source<Profile>(profile_->GetOriginalProfile())); | 368 content::Source<Profile>(profile_->GetOriginalProfile())); |
| 369 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 369 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
| 370 content::Source<Profile>(profile_->GetOriginalProfile())); | 370 content::Source<Profile>(profile_->GetOriginalProfile())); |
| 371 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, | 371 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
| 372 content::Source<Profile>(profile_->GetOriginalProfile())); | 372 content::Source<Profile>(profile_->GetOriginalProfile())); |
| 373 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 373 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
| 374 content::NotificationService::AllSources()); | 374 content::NotificationService::AllSources()); |
| 375 #if !defined(OS_ANDROID) | |
|
Ben Goodger (Google)
2012/03/08 23:33:48
akin to my comment in the other CL: USE_THEMES?
| |
| 376 // TODO(yfriedman): remove OS_ANDROID clause when browser is excluded from | |
| 377 // Android build. | |
| 375 registrar_.Add( | 378 registrar_.Add( |
| 376 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 379 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
| 377 content::Source<ThemeService>( | 380 content::Source<ThemeService>( |
| 378 ThemeServiceFactory::GetForProfile(profile_))); | 381 ThemeServiceFactory::GetForProfile(profile_))); |
| 382 #endif | |
| 379 registrar_.Add(this, chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, | 383 registrar_.Add(this, chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, |
| 380 content::NotificationService::AllSources()); | 384 content::NotificationService::AllSources()); |
| 381 | 385 |
| 382 PrefService* local_state = g_browser_process->local_state(); | 386 PrefService* local_state = g_browser_process->local_state(); |
| 383 if (local_state) { | 387 if (local_state) { |
| 384 local_pref_registrar_.Init(local_state); | 388 local_pref_registrar_.Init(local_state); |
| 385 local_pref_registrar_.Add(prefs::kPrintingEnabled, this); | 389 local_pref_registrar_.Add(prefs::kPrintingEnabled, this); |
| 386 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this); | 390 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this); |
| 387 local_pref_registrar_.Add(prefs::kMetricsReportingEnabled, this); | 391 local_pref_registrar_.Add(prefs::kMetricsReportingEnabled, this); |
| 388 } | 392 } |
| (...skipping 4039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4428 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: | 4432 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: |
| 4429 case chrome::NOTIFICATION_EXTENSION_LOADED: | 4433 case chrome::NOTIFICATION_EXTENSION_LOADED: |
| 4430 // During window creation on Windows we may end up calling into | 4434 // During window creation on Windows we may end up calling into |
| 4431 // SHAppBarMessage, which internally spawns a nested message loop. This | 4435 // SHAppBarMessage, which internally spawns a nested message loop. This |
| 4432 // makes it possible for us to end up here before window creation has | 4436 // makes it possible for us to end up here before window creation has |
| 4433 // completed,at which point window_ is NULL. See 94752 for details. | 4437 // completed,at which point window_ is NULL. See 94752 for details. |
| 4434 if (window() && window()->GetLocationBar()) | 4438 if (window() && window()->GetLocationBar()) |
| 4435 window()->GetLocationBar()->UpdatePageActions(); | 4439 window()->GetLocationBar()->UpdatePageActions(); |
| 4436 break; | 4440 break; |
| 4437 | 4441 |
| 4442 #if !defined(OS_ANDROID) | |
| 4443 // TODO(yfriedman): remove OS_ANDROID clause when browser is excluded from | |
| 4444 // Android build. | |
| 4438 case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: | 4445 case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: |
| 4439 window()->UserChangedTheme(); | 4446 window()->UserChangedTheme(); |
| 4440 break; | 4447 break; |
| 4448 #endif | |
| 4441 | 4449 |
| 4442 case chrome::NOTIFICATION_PREF_CHANGED: { | 4450 case chrome::NOTIFICATION_PREF_CHANGED: { |
| 4443 const std::string& pref_name = | 4451 const std::string& pref_name = |
| 4444 *content::Details<std::string>(details).ptr(); | 4452 *content::Details<std::string>(details).ptr(); |
| 4445 if (pref_name == prefs::kPrintingEnabled) { | 4453 if (pref_name == prefs::kPrintingEnabled) { |
| 4446 UpdatePrintingState(GetContentRestrictionsForSelectedTab()); | 4454 UpdatePrintingState(GetContentRestrictionsForSelectedTab()); |
| 4447 } else if (pref_name == prefs::kInstantEnabled || | 4455 } else if (pref_name == prefs::kInstantEnabled || |
| 4448 pref_name == prefs::kMetricsReportingEnabled || | 4456 pref_name == prefs::kMetricsReportingEnabled || |
| 4449 pref_name == prefs::kSearchSuggestEnabled) { | 4457 pref_name == prefs::kSearchSuggestEnabled) { |
| 4450 if (!InstantController::IsEnabled(profile())) { | 4458 if (!InstantController::IsEnabled(profile())) { |
| (...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5646 ShowSingletonTabOverwritingNTP(params); | 5654 ShowSingletonTabOverwritingNTP(params); |
| 5647 } else { | 5655 } else { |
| 5648 LoginUIServiceFactory::GetForProfile( | 5656 LoginUIServiceFactory::GetForProfile( |
| 5649 profile()->GetOriginalProfile())->ShowLoginUI(); | 5657 profile()->GetOriginalProfile())->ShowLoginUI(); |
| 5650 } | 5658 } |
| 5651 } | 5659 } |
| 5652 | 5660 |
| 5653 void Browser::ToggleSpeechInput() { | 5661 void Browser::ToggleSpeechInput() { |
| 5654 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5662 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
| 5655 } | 5663 } |
| OLD | NEW |