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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
362 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, | 362 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, |
363 content::Source<Profile>(profile_->GetOriginalProfile())); | 363 content::Source<Profile>(profile_->GetOriginalProfile())); |
364 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 364 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
365 content::Source<Profile>(profile_->GetOriginalProfile())); | 365 content::Source<Profile>(profile_->GetOriginalProfile())); |
366 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 366 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
367 content::Source<Profile>(profile_->GetOriginalProfile())); | 367 content::Source<Profile>(profile_->GetOriginalProfile())); |
368 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, | 368 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
369 content::Source<Profile>(profile_->GetOriginalProfile())); | 369 content::Source<Profile>(profile_->GetOriginalProfile())); |
370 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 370 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
371 content::NotificationService::AllSources()); | 371 content::NotificationService::AllSources()); |
372 #if !defined(OS_ANDROID) | |
372 registrar_.Add( | 373 registrar_.Add( |
Yaron
2012/02/29 00:02:17
Please add TODO(yfriedman): Remove this ifdef when
| |
373 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 374 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
374 content::Source<ThemeService>( | 375 content::Source<ThemeService>( |
375 ThemeServiceFactory::GetForProfile(profile_))); | 376 ThemeServiceFactory::GetForProfile(profile_))); |
377 #endif | |
376 registrar_.Add(this, chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, | 378 registrar_.Add(this, chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, |
377 content::NotificationService::AllSources()); | 379 content::NotificationService::AllSources()); |
378 | 380 |
379 PrefService* local_state = g_browser_process->local_state(); | 381 PrefService* local_state = g_browser_process->local_state(); |
380 if (local_state) { | 382 if (local_state) { |
381 local_pref_registrar_.Init(local_state); | 383 local_pref_registrar_.Init(local_state); |
382 local_pref_registrar_.Add(prefs::kPrintingEnabled, this); | 384 local_pref_registrar_.Add(prefs::kPrintingEnabled, this); |
383 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this); | 385 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this); |
384 local_pref_registrar_.Add(prefs::kMetricsReportingEnabled, this); | 386 local_pref_registrar_.Add(prefs::kMetricsReportingEnabled, this); |
385 } | 387 } |
(...skipping 5199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5585 } | 5587 } |
5586 | 5588 |
5587 BookmarkBar::AnimateChangeType animate_type = | 5589 BookmarkBar::AnimateChangeType animate_type = |
5588 (reason == BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE) ? | 5590 (reason == BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE) ? |
5589 BookmarkBar::ANIMATE_STATE_CHANGE : | 5591 BookmarkBar::ANIMATE_STATE_CHANGE : |
5590 BookmarkBar::DONT_ANIMATE_STATE_CHANGE; | 5592 BookmarkBar::DONT_ANIMATE_STATE_CHANGE; |
5591 window_->BookmarkBarStateChanged(animate_type); | 5593 window_->BookmarkBarStateChanged(animate_type); |
5592 } | 5594 } |
5593 | 5595 |
5594 void Browser::ShowSyncSetup() { | 5596 void Browser::ShowSyncSetup() { |
5597 #if !defined(OS_ANDROID) | |
5595 ProfileSyncService* service = | 5598 ProfileSyncService* service = |
5596 ProfileSyncServiceFactory::GetInstance()->GetForProfile( | 5599 ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
5597 profile()->GetOriginalProfile()); | 5600 profile()->GetOriginalProfile()); |
5598 LoginUIService* login_service = | 5601 LoginUIService* login_service = |
5599 LoginUIServiceFactory::GetForProfile(profile()->GetOriginalProfile()); | 5602 LoginUIServiceFactory::GetForProfile(profile()->GetOriginalProfile()); |
5600 if (service->HasSyncSetupCompleted()) { | 5603 if (service->HasSyncSetupCompleted()) { |
5601 ShowOptionsTab(chrome::kPersonalOptionsSubPage); | 5604 ShowOptionsTab(chrome::kPersonalOptionsSubPage); |
5602 } else if (SyncPromoUI::ShouldShowSyncPromo(profile()) && | 5605 } else if (SyncPromoUI::ShouldShowSyncPromo(profile()) && |
5603 login_service->current_login_ui() == NULL) { | 5606 login_service->current_login_ui() == NULL) { |
5604 // There is no currently active login UI, so display a new promo page. | 5607 // There is no currently active login UI, so display a new promo page. |
5605 GURL url(SyncPromoUI::GetSyncPromoURL(GURL(), false, std::string())); | 5608 GURL url(SyncPromoUI::GetSyncPromoURL(GURL(), false, std::string())); |
5606 browser::NavigateParams params(GetSingletonTabNavigateParams(GURL(url))); | 5609 browser::NavigateParams params(GetSingletonTabNavigateParams(GURL(url))); |
5607 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; | 5610 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; |
5608 ShowSingletonTabOverwritingNTP(params); | 5611 ShowSingletonTabOverwritingNTP(params); |
5609 } else { | 5612 } else { |
5610 LoginUIServiceFactory::GetForProfile( | 5613 LoginUIServiceFactory::GetForProfile( |
5611 profile()->GetOriginalProfile())->ShowLoginUI(); | 5614 profile()->GetOriginalProfile())->ShowLoginUI(); |
5612 } | 5615 } |
5616 #endif | |
5613 } | 5617 } |
5614 | 5618 |
5615 void Browser::ToggleSpeechInput() { | 5619 void Browser::ToggleSpeechInput() { |
5616 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5620 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
5617 } | 5621 } |
OLD | NEW |