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

Unified Diff: chrome/browser/extensions/extension_action.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/crx_installer.cc ('k') | chrome/browser/extensions/extension_disabled_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_action.cc
diff --git a/chrome/browser/extensions/extension_action.cc b/chrome/browser/extensions/extension_action.cc
index f86760ff145beb6fc6afced2a45cd95f6bffd999..62172ea7e64b5ec1b2882085f91b200190e00c5c 100644
--- a/chrome/browser/extensions/extension_action.cc
+++ b/chrome/browser/extensions/extension_action.cc
@@ -70,7 +70,7 @@ class AnimatedIconImageSource : public gfx::ImageSkiaSource {
virtual gfx::ImageSkiaRep GetImageForScale(ui::ScaleFactor scale) OVERRIDE {
gfx::ImageSkiaRep original_rep = image_.GetRepresentation(scale);
- if (!animation_)
+ if (!animation_.get())
return original_rep;
// Original representation's scale factor may be different from scale
@@ -149,12 +149,12 @@ ExtensionAction::IconAnimation::ScopedObserver::ScopedObserver(
Observer* observer)
: icon_animation_(icon_animation),
observer_(observer) {
- if (icon_animation)
+ if (icon_animation.get())
icon_animation->AddObserver(observer);
}
ExtensionAction::IconAnimation::ScopedObserver::~ScopedObserver() {
- if (icon_animation_)
+ if (icon_animation_.get())
icon_animation_->RemoveObserver(observer_);
}
@@ -354,14 +354,14 @@ base::WeakPtr<ExtensionAction::IconAnimation> ExtensionAction::GetIconAnimation(
icon_animation_.find(tab_id);
if (it == icon_animation_.end())
return base::WeakPtr<ExtensionAction::IconAnimation>();
- if (it->second)
+ if (it->second.get())
return it->second;
// Take this opportunity to remove all the NULL IconAnimations from
// icon_animation_.
icon_animation_.erase(it);
for (it = icon_animation_.begin(); it != icon_animation_.end();) {
- if (it->second) {
+ if (it->second.get()) {
++it;
} else {
// The WeakPtr is null; remove it from the map.
@@ -375,7 +375,7 @@ gfx::ImageSkia ExtensionAction::ApplyIconAnimation(
int tab_id,
const gfx::ImageSkia& icon) const {
base::WeakPtr<IconAnimation> animation = GetIconAnimation(tab_id);
- if (animation == NULL)
+ if (animation.get() == NULL)
return icon;
return gfx::ImageSkia(new AnimatedIconImageSource(icon, animation),
« no previous file with comments | « chrome/browser/extensions/crx_installer.cc ('k') | chrome/browser/extensions/extension_disabled_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698