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

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

Issue 3210007: Add support for a "split" incognito behavior for extensions. (Closed)
Patch Set: latest Created 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser.h" 5 #include "chrome/browser/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <shellapi.h> 8 #include <shellapi.h>
9 #include <windows.h> 9 #include <windows.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 3034 matching lines...) Expand 10 before | Expand all | Expand 10 after
3045 // closing of this one. 3045 // closing of this one.
3046 if (GetSelectedTabContents() && 3046 if (GetSelectedTabContents() &&
3047 &GetSelectedTabContents()->controller() == 3047 &GetSelectedTabContents()->controller() ==
3048 Source<NavigationController>(source).ptr()) 3048 Source<NavigationController>(source).ptr())
3049 UpdateToolbar(false); 3049 UpdateToolbar(false);
3050 break; 3050 break;
3051 3051
3052 case NotificationType::EXTENSION_UPDATE_DISABLED: { 3052 case NotificationType::EXTENSION_UPDATE_DISABLED: {
3053 // Show the UI if the extension was disabled for escalated permissions. 3053 // Show the UI if the extension was disabled for escalated permissions.
3054 Profile* profile = Source<Profile>(source).ptr(); 3054 Profile* profile = Source<Profile>(source).ptr();
3055 DCHECK_EQ(profile_, profile); 3055 if (profile_->IsSameProfile(profile)) {
3056 ExtensionsService* service = profile->GetExtensionsService(); 3056 ExtensionsService* service = profile->GetExtensionsService();
3057 DCHECK(service); 3057 DCHECK(service);
3058 Extension* extension = Details<Extension>(details).ptr(); 3058 Extension* extension = Details<Extension>(details).ptr();
3059 if (service->extension_prefs()->DidExtensionEscalatePermissions( 3059 if (service->extension_prefs()->DidExtensionEscalatePermissions(
3060 extension->id())) 3060 extension->id()))
3061 ShowExtensionDisabledUI(service, profile_, extension); 3061 ShowExtensionDisabledUI(service, profile_, extension);
3062 }
3062 break; 3063 break;
3063 } 3064 }
3064 3065
3065 case NotificationType::EXTENSION_UNLOADED: 3066 case NotificationType::EXTENSION_UNLOADED:
3066 case NotificationType::EXTENSION_UNLOADED_DISABLED: { 3067 case NotificationType::EXTENSION_UNLOADED_DISABLED: {
3067 window()->GetLocationBar()->UpdatePageActions(); 3068 window()->GetLocationBar()->UpdatePageActions();
3068 3069
3069 // Close any tabs from the unloaded extension. 3070 // Close any tabs from the unloaded extension.
3070 Extension* extension = Details<Extension>(details).ptr(); 3071 Extension* extension = Details<Extension>(details).ptr();
3071 for (int i = 0; i < tabstrip_model_.count(); i++) { 3072 for (int i = 0; i < tabstrip_model_.count(); i++) {
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
4016 } 4017 }
4017 4018
4018 void Browser::TabRestoreServiceDestroyed(TabRestoreService* service) { 4019 void Browser::TabRestoreServiceDestroyed(TabRestoreService* service) {
4019 if (!tab_restore_service_) 4020 if (!tab_restore_service_)
4020 return; 4021 return;
4021 4022
4022 DCHECK_EQ(tab_restore_service_, service); 4023 DCHECK_EQ(tab_restore_service_, service);
4023 tab_restore_service_->RemoveObserver(this); 4024 tab_restore_service_->RemoveObserver(this);
4024 tab_restore_service_ = NULL; 4025 tab_restore_service_ = NULL;
4025 } 4026 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698