Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 NotificationService::AllSources()); | 269 NotificationService::AllSources()); |
| 270 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 270 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
| 271 NotificationService::AllSources()); | 271 NotificationService::AllSources()); |
| 272 registrar_.Add( | 272 registrar_.Add( |
| 273 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 273 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
| 274 Source<ThemeService>(ThemeServiceFactory::GetForProfile(profile_))); | 274 Source<ThemeService>(ThemeServiceFactory::GetForProfile(profile_))); |
| 275 registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED, | 275 registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED, |
| 276 NotificationService::AllSources()); | 276 NotificationService::AllSources()); |
| 277 registrar_.Add(this, | 277 registrar_.Add(this, |
| 278 chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, | 278 chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, |
| 279 Source<Profile>(profile_)); | 279 NotificationService::AllBrowserContextsAndSources()); |
|
Peter Kasting
2011/08/10 21:03:21
Nit: Might want to comment somewhere that we need
| |
| 280 | 280 |
| 281 // Need to know when to alert the user of theme install delay. | 281 // Need to know when to alert the user of theme install delay. |
| 282 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_READY_FOR_INSTALL, | 282 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_READY_FOR_INSTALL, |
| 283 NotificationService::AllSources()); | 283 NotificationService::AllSources()); |
| 284 | 284 |
| 285 PrefService* local_state = g_browser_process->local_state(); | 285 PrefService* local_state = g_browser_process->local_state(); |
| 286 if (local_state) { | 286 if (local_state) { |
| 287 local_pref_registrar_.Init(local_state); | 287 local_pref_registrar_.Init(local_state); |
| 288 local_pref_registrar_.Add(prefs::kPrintingEnabled, this); | 288 local_pref_registrar_.Add(prefs::kPrintingEnabled, this); |
| 289 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this); | 289 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this); |
| (...skipping 3451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3741 location_bar->UpdateContentSettingsIcons(); | 3741 location_bar->UpdateContentSettingsIcons(); |
| 3742 } | 3742 } |
| 3743 break; | 3743 break; |
| 3744 } | 3744 } |
| 3745 | 3745 |
| 3746 case content::NOTIFICATION_INTERSTITIAL_ATTACHED: | 3746 case content::NOTIFICATION_INTERSTITIAL_ATTACHED: |
| 3747 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); | 3747 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); |
| 3748 break; | 3748 break; |
| 3749 | 3749 |
| 3750 case chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: | 3750 case chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: |
| 3751 DCHECK_EQ(Source<Profile>(source).ptr(), profile_); | 3751 if (profile_->IsSameProfile(Source<Profile>(source).ptr())) |
| 3752 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE); | 3752 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE); |
| 3753 break; | 3753 break; |
| 3754 | 3754 |
| 3755 default: | 3755 default: |
| 3756 NOTREACHED() << "Got a notification we didn't register for."; | 3756 NOTREACHED() << "Got a notification we didn't register for."; |
| 3757 } | 3757 } |
| 3758 } | 3758 } |
| 3759 | 3759 |
| 3760 /////////////////////////////////////////////////////////////////////////////// | 3760 /////////////////////////////////////////////////////////////////////////////// |
| 3761 // Browser, ProfileSyncServiceObserver implementation: | 3761 // Browser, ProfileSyncServiceObserver implementation: |
| 3762 | 3762 |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4845 } | 4845 } |
| 4846 | 4846 |
| 4847 void Browser::ShowSyncSetup() { | 4847 void Browser::ShowSyncSetup() { |
| 4848 ProfileSyncService* service = | 4848 ProfileSyncService* service = |
| 4849 profile()->GetOriginalProfile()->GetProfileSyncService(); | 4849 profile()->GetOriginalProfile()->GetProfileSyncService(); |
| 4850 if (service->HasSyncSetupCompleted()) | 4850 if (service->HasSyncSetupCompleted()) |
| 4851 ShowOptionsTab(chrome::kSyncSetupSubPage); | 4851 ShowOptionsTab(chrome::kSyncSetupSubPage); |
| 4852 else | 4852 else |
| 4853 service->ShowLoginDialog(); | 4853 service->ShowLoginDialog(); |
| 4854 } | 4854 } |
| OLD | NEW |