Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 7610003: More. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 NotificationService::AllSources()); 267 NotificationService::AllSources());
268 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, 268 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
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 // Need to stay in sync between our incognito and our normal profile.
Peter Kasting 2011/08/10 21:30:15 Nit: "We listen to all notification sources becaus
277 registrar_.Add(this, 278 registrar_.Add(this,
278 chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, 279 chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED,
279 Source<Profile>(profile_)); 280 NotificationService::AllBrowserContextsAndSources());
280 281
281 // Need to know when to alert the user of theme install delay. 282 // Need to know when to alert the user of theme install delay.
282 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_READY_FOR_INSTALL, 283 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_READY_FOR_INSTALL,
283 NotificationService::AllSources()); 284 NotificationService::AllSources());
284 285
285 PrefService* local_state = g_browser_process->local_state(); 286 PrefService* local_state = g_browser_process->local_state();
286 if (local_state) { 287 if (local_state) {
287 local_pref_registrar_.Init(local_state); 288 local_pref_registrar_.Init(local_state);
288 local_pref_registrar_.Add(prefs::kPrintingEnabled, this); 289 local_pref_registrar_.Add(prefs::kPrintingEnabled, this);
289 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this); 290 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this);
(...skipping 3451 matching lines...) Expand 10 before | Expand all | Expand 10 after
3741 location_bar->UpdateContentSettingsIcons(); 3742 location_bar->UpdateContentSettingsIcons();
3742 } 3743 }
3743 break; 3744 break;
3744 } 3745 }
3745 3746
3746 case content::NOTIFICATION_INTERSTITIAL_ATTACHED: 3747 case content::NOTIFICATION_INTERSTITIAL_ATTACHED:
3747 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); 3748 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE);
3748 break; 3749 break;
3749 3750
3750 case chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: 3751 case chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED:
3751 DCHECK_EQ(Source<Profile>(source).ptr(), profile_); 3752 if (profile_->IsSameProfile(Source<Profile>(source).ptr()))
3752 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE); 3753 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE);
3753 break; 3754 break;
3754 3755
3755 default: 3756 default:
3756 NOTREACHED() << "Got a notification we didn't register for."; 3757 NOTREACHED() << "Got a notification we didn't register for.";
3757 } 3758 }
3758 } 3759 }
3759 3760
3760 /////////////////////////////////////////////////////////////////////////////// 3761 ///////////////////////////////////////////////////////////////////////////////
3761 // Browser, ProfileSyncServiceObserver implementation: 3762 // Browser, ProfileSyncServiceObserver implementation:
3762 3763
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
4845 } 4846 }
4846 4847
4847 void Browser::ShowSyncSetup() { 4848 void Browser::ShowSyncSetup() {
4848 ProfileSyncService* service = 4849 ProfileSyncService* service =
4849 profile()->GetOriginalProfile()->GetProfileSyncService(); 4850 profile()->GetOriginalProfile()->GetProfileSyncService();
4850 if (service->HasSyncSetupCompleted()) 4851 if (service->HasSyncSetupCompleted())
4851 ShowOptionsTab(chrome::kSyncSetupSubPage); 4852 ShowOptionsTab(chrome::kSyncSetupSubPage);
4852 else 4853 else
4853 service->ShowLoginDialog(); 4854 service->ShowLoginDialog();
4854 } 4855 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698