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

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

Issue 242613004: Replace NOTIFICATION_EXTENSION_LOADED to NOTIFICATION_EXTENSION_LOADED_DEPRECATED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/external_install_ui.h" 5 #include "chrome/browser/extensions/external_install_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 Release(); 333 Release();
334 } 334 }
335 335
336 // ExternalInstallMenuAlert ------------------------------------------------- 336 // ExternalInstallMenuAlert -------------------------------------------------
337 337
338 ExternalInstallMenuAlert::ExternalInstallMenuAlert( 338 ExternalInstallMenuAlert::ExternalInstallMenuAlert(
339 ExtensionService* service, 339 ExtensionService* service,
340 const Extension* extension) 340 const Extension* extension)
341 : service_(service), 341 : service_(service),
342 extension_(extension) { 342 extension_(extension) {
343 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 343 registrar_.Add(this,
344 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
344 content::Source<Profile>(service->profile())); 345 content::Source<Profile>(service->profile()));
345 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_REMOVED, 346 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_REMOVED,
346 content::Source<Profile>(service->profile())); 347 content::Source<Profile>(service->profile()));
347 } 348 }
348 349
349 ExternalInstallMenuAlert::~ExternalInstallMenuAlert() { 350 ExternalInstallMenuAlert::~ExternalInstallMenuAlert() {
350 } 351 }
351 352
352 GlobalError::Severity ExternalInstallMenuAlert::GetSeverity() { 353 GlobalError::Severity ExternalInstallMenuAlert::GetSeverity() {
353 return SEVERITY_LOW; 354 return SEVERITY_LOW;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 void ExternalInstallMenuAlert::BubbleViewCancelButtonPressed( 408 void ExternalInstallMenuAlert::BubbleViewCancelButtonPressed(
408 Browser* browser) { 409 Browser* browser) {
409 NOTREACHED(); 410 NOTREACHED();
410 } 411 }
411 412
412 void ExternalInstallMenuAlert::Observe( 413 void ExternalInstallMenuAlert::Observe(
413 int type, 414 int type,
414 const content::NotificationSource& source, 415 const content::NotificationSource& source,
415 const content::NotificationDetails& details) { 416 const content::NotificationDetails& details) {
416 // The error is invalidated if the extension has been loaded or removed. 417 // The error is invalidated if the extension has been loaded or removed.
417 DCHECK(type == chrome::NOTIFICATION_EXTENSION_LOADED || 418 DCHECK(type == chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED ||
418 type == chrome::NOTIFICATION_EXTENSION_REMOVED); 419 type == chrome::NOTIFICATION_EXTENSION_REMOVED);
419 const Extension* extension = content::Details<const Extension>(details).ptr(); 420 const Extension* extension = content::Details<const Extension>(details).ptr();
420 if (extension != extension_) 421 if (extension != extension_)
421 return; 422 return;
422 GlobalErrorService* error_service = 423 GlobalErrorService* error_service =
423 GlobalErrorServiceFactory::GetForProfile(service_->profile()); 424 GlobalErrorServiceFactory::GetForProfile(service_->profile());
424 error_service->RemoveGlobalError(this); 425 error_service->RemoveGlobalError(this);
425 service_->AcknowledgeExternalExtension(extension_->id()); 426 service_->AcknowledgeExternalExtension(extension_->id());
426 delete this; 427 delete this;
427 } 428 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 553
553 bool HasExternalInstallBubble(ExtensionService* service) { 554 bool HasExternalInstallBubble(ExtensionService* service) {
554 GlobalErrorService* error_service = 555 GlobalErrorService* error_service =
555 GlobalErrorServiceFactory::GetForProfile(service->profile()); 556 GlobalErrorServiceFactory::GetForProfile(service->profile());
556 GlobalError* error = error_service->GetGlobalErrorByMenuItemCommandID( 557 GlobalError* error = error_service->GetGlobalErrorByMenuItemCommandID(
557 kMenuCommandId); 558 kMenuCommandId);
558 return error && error->HasBubbleView(); 559 return error && error->HasBubbleView();
559 } 560 }
560 561
561 } // namespace extensions 562 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_web_ui_override_registrar.cc ('k') | chrome/browser/extensions/install_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698