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

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

Issue 5968009: Change extension unload notification to indicate updates.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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) 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/ui/browser.h" 5 #include "chrome/browser/ui/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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 last_blocked_command_disposition_(CURRENT_TAB), 206 last_blocked_command_disposition_(CURRENT_TAB),
207 pending_web_app_action_(NONE) { 207 pending_web_app_action_(NONE) {
208 registrar_.Add(this, NotificationType::SSL_VISIBLE_STATE_CHANGED, 208 registrar_.Add(this, NotificationType::SSL_VISIBLE_STATE_CHANGED,
209 NotificationService::AllSources()); 209 NotificationService::AllSources());
210 registrar_.Add(this, NotificationType::EXTENSION_UPDATE_DISABLED, 210 registrar_.Add(this, NotificationType::EXTENSION_UPDATE_DISABLED,
211 NotificationService::AllSources()); 211 NotificationService::AllSources());
212 registrar_.Add(this, NotificationType::EXTENSION_LOADED, 212 registrar_.Add(this, NotificationType::EXTENSION_LOADED,
213 NotificationService::AllSources()); 213 NotificationService::AllSources());
214 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, 214 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
215 NotificationService::AllSources()); 215 NotificationService::AllSources());
216 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED_DISABLED,
217 NotificationService::AllSources());
218 registrar_.Add(this, NotificationType::EXTENSION_PROCESS_TERMINATED, 216 registrar_.Add(this, NotificationType::EXTENSION_PROCESS_TERMINATED,
219 NotificationService::AllSources()); 217 NotificationService::AllSources());
220 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, 218 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED,
221 NotificationService::AllSources()); 219 NotificationService::AllSources());
222 registrar_.Add(this, NotificationType::PROFILE_ERROR, 220 registrar_.Add(this, NotificationType::PROFILE_ERROR,
223 NotificationService::AllSources()); 221 NotificationService::AllSources());
224 222
225 // Need to know when to alert the user of theme install delay. 223 // Need to know when to alert the user of theme install delay.
226 registrar_.Add(this, NotificationType::EXTENSION_READY_FOR_INSTALL, 224 registrar_.Add(this, NotificationType::EXTENSION_READY_FOR_INSTALL,
227 NotificationService::AllSources()); 225 NotificationService::AllSources());
(...skipping 2977 matching lines...) Expand 10 before | Expand all | Expand 10 after
3205 ExtensionService* service = profile->GetExtensionService(); 3203 ExtensionService* service = profile->GetExtensionService();
3206 DCHECK(service); 3204 DCHECK(service);
3207 const Extension* extension = Details<const Extension>(details).ptr(); 3205 const Extension* extension = Details<const Extension>(details).ptr();
3208 if (service->extension_prefs()->DidExtensionEscalatePermissions( 3206 if (service->extension_prefs()->DidExtensionEscalatePermissions(
3209 extension->id())) 3207 extension->id()))
3210 ShowExtensionDisabledUI(service, profile_, extension); 3208 ShowExtensionDisabledUI(service, profile_, extension);
3211 } 3209 }
3212 break; 3210 break;
3213 } 3211 }
3214 3212
3215 case NotificationType::EXTENSION_UNLOADED: 3213 case NotificationType::EXTENSION_UNLOADED: {
3216 case NotificationType::EXTENSION_UNLOADED_DISABLED: {
3217 window()->GetLocationBar()->UpdatePageActions(); 3214 window()->GetLocationBar()->UpdatePageActions();
3218 3215
3219 // Close any tabs from the unloaded extension. 3216 // Close any tabs from the unloaded extension.
3220 const Extension* extension = Details<const Extension>(details).ptr(); 3217 const Extension* extension =
3218 Details<UnloadedExtensionInfo>(details)->extension;
3221 TabStripModel* model = tab_handler_->GetTabStripModel(); 3219 TabStripModel* model = tab_handler_->GetTabStripModel();
3222 for (int i = model->count() - 1; i >= 0; --i) { 3220 for (int i = model->count() - 1; i >= 0; --i) {
3223 TabContents* tc = model->GetTabContentsAt(i)->tab_contents(); 3221 TabContents* tc = model->GetTabContentsAt(i)->tab_contents();
3224 if (tc->GetURL().SchemeIs(chrome::kExtensionScheme) && 3222 if (tc->GetURL().SchemeIs(chrome::kExtensionScheme) &&
3225 tc->GetURL().host() == extension->id()) { 3223 tc->GetURL().host() == extension->id()) {
3226 CloseTabContents(tc); 3224 CloseTabContents(tc);
3227 } 3225 }
3228 } 3226 }
3229 3227
3230 break; 3228 break;
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
4226 // The page transition below is only for the purpose of inserting the tab. 4224 // The page transition below is only for the purpose of inserting the tab.
4227 browser->AddTab(contents_dupe, PageTransition::LINK); 4225 browser->AddTab(contents_dupe, PageTransition::LINK);
4228 } 4226 }
4229 4227
4230 if (profile_->HasSessionService()) { 4228 if (profile_->HasSessionService()) {
4231 SessionService* session_service = profile_->GetSessionService(); 4229 SessionService* session_service = profile_->GetSessionService();
4232 if (session_service) 4230 if (session_service)
4233 session_service->TabRestored(&new_contents->controller(), pinned); 4231 session_service->TabRestored(&new_contents->controller(), pinned);
4234 } 4232 }
4235 } 4233 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698