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

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

Issue 15987009: Update chrome/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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) 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/extension_disabled_ui.h" 5 #include "chrome/browser/extensions/extension_disabled_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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 345
346 namespace extensions { 346 namespace extensions {
347 347
348 void AddExtensionDisabledErrorWithIcon(base::WeakPtr<ExtensionService> service, 348 void AddExtensionDisabledErrorWithIcon(base::WeakPtr<ExtensionService> service,
349 const std::string& extension_id, 349 const std::string& extension_id,
350 const gfx::Image& icon) { 350 const gfx::Image& icon) {
351 if (!service.get()) 351 if (!service.get())
352 return; 352 return;
353 const Extension* extension = service->GetInstalledExtension(extension_id); 353 const Extension* extension = service->GetInstalledExtension(extension_id);
354 if (extension) { 354 if (extension) {
355 GlobalErrorServiceFactory::GetForProfile(service->profile())-> 355 GlobalErrorServiceFactory::GetForProfile(service->profile())
356 AddGlobalError(new ExtensionDisabledGlobalError( 356 ->AddGlobalError(
357 service, extension, icon)); 357 new ExtensionDisabledGlobalError(service.get(), extension, icon));
358 } 358 }
359 } 359 }
360 360
361 void AddExtensionDisabledError(ExtensionService* service, 361 void AddExtensionDisabledError(ExtensionService* service,
362 const Extension* extension) { 362 const Extension* extension) {
363 extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource( 363 extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource(
364 extension, kIconSize, ExtensionIconSet::MATCH_BIGGER); 364 extension, kIconSize, ExtensionIconSet::MATCH_BIGGER);
365 gfx::Size size(kIconSize, kIconSize); 365 gfx::Size size(kIconSize, kIconSize);
366 ImageLoader::Get(service->profile())->LoadImageAsync( 366 ImageLoader::Get(service->profile())->LoadImageAsync(
367 extension, image, size, 367 extension, image, size,
368 base::Bind(&AddExtensionDisabledErrorWithIcon, 368 base::Bind(&AddExtensionDisabledErrorWithIcon,
369 service->AsWeakPtr(), extension->id())); 369 service->AsWeakPtr(), extension->id()));
370 } 370 }
371 371
372 void ShowExtensionDisabledDialog(ExtensionService* service, 372 void ShowExtensionDisabledDialog(ExtensionService* service,
373 content::WebContents* web_contents, 373 content::WebContents* web_contents,
374 const Extension* extension) { 374 const Extension* extension) {
375 scoped_ptr<ExtensionInstallPrompt> install_ui( 375 scoped_ptr<ExtensionInstallPrompt> install_ui(
376 new ExtensionInstallPrompt(web_contents)); 376 new ExtensionInstallPrompt(web_contents));
377 // This object manages its own lifetime. 377 // This object manages its own lifetime.
378 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); 378 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension);
379 } 379 }
380 380
381 } // namespace extensions 381 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_action.cc ('k') | chrome/browser/extensions/extension_function_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698