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

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

Issue 7610003: More. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments 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 // We listen to all notification sources because the bookmark bar
278 // state needs to stay in sync between the incognito and normal profiles.
277 registrar_.Add(this, 279 registrar_.Add(this,
278 chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, 280 chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED,
279 Source<Profile>(profile_)); 281 NotificationService::AllBrowserContextsAndSources());
280 282
281 // Need to know when to alert the user of theme install delay. 283 // Need to know when to alert the user of theme install delay.
282 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_READY_FOR_INSTALL, 284 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_READY_FOR_INSTALL,
283 NotificationService::AllSources()); 285 NotificationService::AllSources());
284 286
285 PrefService* local_state = g_browser_process->local_state(); 287 PrefService* local_state = g_browser_process->local_state();
286 if (local_state) { 288 if (local_state) {
287 local_pref_registrar_.Init(local_state); 289 local_pref_registrar_.Init(local_state);
288 local_pref_registrar_.Add(prefs::kPrintingEnabled, this); 290 local_pref_registrar_.Add(prefs::kPrintingEnabled, this);
289 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this); 291 local_pref_registrar_.Add(prefs::kAllowFileSelectionDialogs, this);
(...skipping 3451 matching lines...) Expand 10 before | Expand all | Expand 10 after
3741 location_bar->UpdateContentSettingsIcons(); 3743 location_bar->UpdateContentSettingsIcons();
3742 } 3744 }
3743 break; 3745 break;
3744 } 3746 }
3745 3747
3746 case content::NOTIFICATION_INTERSTITIAL_ATTACHED: 3748 case content::NOTIFICATION_INTERSTITIAL_ATTACHED:
3747 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); 3749 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE);
3748 break; 3750 break;
3749 3751
3750 case chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED: 3752 case chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED:
3751 DCHECK_EQ(Source<Profile>(source).ptr(), profile_); 3753 if (profile_->IsSameProfile(Source<Profile>(source).ptr()))
3752 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE); 3754 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE);
3753 break; 3755 break;
3754 3756
3755 default: 3757 default:
3756 NOTREACHED() << "Got a notification we didn't register for."; 3758 NOTREACHED() << "Got a notification we didn't register for.";
3757 } 3759 }
3758 } 3760 }
3759 3761
3760 /////////////////////////////////////////////////////////////////////////////// 3762 ///////////////////////////////////////////////////////////////////////////////
3761 // Browser, ProfileSyncServiceObserver implementation: 3763 // Browser, ProfileSyncServiceObserver implementation:
3762 3764
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
4845 } 4847 }
4846 4848
4847 void Browser::ShowSyncSetup() { 4849 void Browser::ShowSyncSetup() {
4848 ProfileSyncService* service = 4850 ProfileSyncService* service =
4849 profile()->GetOriginalProfile()->GetProfileSyncService(); 4851 profile()->GetOriginalProfile()->GetProfileSyncService();
4850 if (service->HasSyncSetupCompleted()) 4852 if (service->HasSyncSetupCompleted())
4851 ShowOptionsTab(chrome::kSyncSetupSubPage); 4853 ShowOptionsTab(chrome::kSyncSetupSubPage);
4852 else 4854 else
4853 service->ShowLoginDialog(); 4855 service->ShowLoginDialog();
4854 } 4856 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_cookies_api.cc ('k') | chrome/browser/ui/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698