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

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

Issue 7799008: Fix crash on NTP related to multi-profile extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix sources for incognito Created 9 years, 3 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 new BrowserTabRestoreServiceDelegate(this))), 266 new BrowserTabRestoreServiceDelegate(this))),
267 ALLOW_THIS_IN_INITIALIZER_LIST( 267 ALLOW_THIS_IN_INITIALIZER_LIST(
268 synced_window_delegate_( 268 synced_window_delegate_(
269 new BrowserSyncedWindowDelegate(this))), 269 new BrowserSyncedWindowDelegate(this))),
270 bookmark_bar_state_(BookmarkBar::HIDDEN), 270 bookmark_bar_state_(BookmarkBar::HIDDEN),
271 fullscreened_tab_(NULL), 271 fullscreened_tab_(NULL),
272 tab_caused_fullscreen_(false) { 272 tab_caused_fullscreen_(false) {
273 registrar_.Add(this, content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED, 273 registrar_.Add(this, content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED,
274 NotificationService::AllSources()); 274 NotificationService::AllSources());
275 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, 275 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED,
276 NotificationService::AllSources()); 276 Source<Profile>(profile_));
277 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 277 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
278 NotificationService::AllSources()); 278 Source<Profile>(profile_));
279 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 279 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
280 NotificationService::AllSources()); 280 Source<Profile>(profile_));
281 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, 281 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
282 NotificationService::AllSources()); 282 Source<Profile>(profile_));
283 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, 283 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
284 NotificationService::AllSources()); 284 NotificationService::AllSources());
285 registrar_.Add( 285 registrar_.Add(
286 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, 286 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
287 Source<ThemeService>(ThemeServiceFactory::GetForProfile(profile_))); 287 Source<ThemeService>(ThemeServiceFactory::GetForProfile(profile_)));
288 registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED, 288 registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENT_SETTINGS_CHANGED,
289 NotificationService::AllSources()); 289 NotificationService::AllSources());
290 // We listen to all notification sources because the bookmark bar 290 // We listen to all notification sources because the bookmark bar
291 // state needs to stay in sync between the incognito and normal profiles. 291 // state needs to stay in sync between the incognito and normal profiles.
292 registrar_.Add(this, 292 registrar_.Add(this,
(...skipping 3620 matching lines...) Expand 10 before | Expand all | Expand 10 after
3913 if (tc->GetURL().SchemeIs(chrome::kExtensionScheme) && 3913 if (tc->GetURL().SchemeIs(chrome::kExtensionScheme) &&
3914 tc->GetURL().host() == extension->id()) { 3914 tc->GetURL().host() == extension->id()) {
3915 CloseTabContents(tc); 3915 CloseTabContents(tc);
3916 } 3916 }
3917 } 3917 }
3918 3918
3919 break; 3919 break;
3920 } 3920 }
3921 3921
3922 case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: { 3922 case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: {
3923 if (window()->GetLocationBar()) 3923 Profile* profile = Source<Profile>(source).ptr();
3924 if (profile_->IsSameProfile(profile) && window()->GetLocationBar())
jstritar 2011/08/30 15:06:31 I think this can come from an incognito profile, s
3924 window()->GetLocationBar()->InvalidatePageActions(); 3925 window()->GetLocationBar()->InvalidatePageActions();
3925 break; 3926 break;
3926 } 3927 }
3927 3928
3928 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: 3929 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED:
3929 case chrome::NOTIFICATION_EXTENSION_LOADED: 3930 case chrome::NOTIFICATION_EXTENSION_LOADED:
3930 if (window()->GetLocationBar()) 3931 if (window()->GetLocationBar())
3931 window()->GetLocationBar()->UpdatePageActions(); 3932 window()->GetLocationBar()->UpdatePageActions();
3932 break; 3933 break;
3933 3934
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
5116 } 5117 }
5117 5118
5118 void Browser::ShowSyncSetup() { 5119 void Browser::ShowSyncSetup() {
5119 ProfileSyncService* service = 5120 ProfileSyncService* service =
5120 profile()->GetOriginalProfile()->GetProfileSyncService(); 5121 profile()->GetOriginalProfile()->GetProfileSyncService();
5121 if (service->HasSyncSetupCompleted()) 5122 if (service->HasSyncSetupCompleted())
5122 ShowOptionsTab(chrome::kSyncSetupSubPage); 5123 ShowOptionsTab(chrome::kSyncSetupSubPage);
5123 else 5124 else
5124 service->ShowLoginDialog(); 5125 service->ShowLoginDialog();
5125 } 5126 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_management_api.cc ('k') | chrome/browser/ui/webui/ntp/app_launcher_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698