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

Unified Diff: chrome/browser/views/browser_actions_container.cc

Issue 332021: Move page actions over to ExtensionAction2 (Closed)
Patch Set: Review feedback Created 11 years, 2 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
Index: chrome/browser/views/browser_actions_container.cc
diff --git a/chrome/browser/views/browser_actions_container.cc b/chrome/browser/views/browser_actions_container.cc
index f3f02f0624540315584243a7626bbf7ab07095f7..6a916909c98a9dfb7670d7c52459f30d571679e3 100644
--- a/chrome/browser/views/browser_actions_container.cc
+++ b/chrome/browser/views/browser_actions_container.cc
@@ -15,8 +15,6 @@
#include "chrome/browser/view_ids.h"
#include "chrome/browser/views/extensions/extension_popup.h"
#include "chrome/browser/views/toolbar_view.h"
-#include "chrome/common/extensions/extension_action.h"
-#include "chrome/common/extensions/extension_action2.h"
#include "chrome/common/notification_source.h"
#include "chrome/common/notification_type.h"
#include "grit/app_resources.h"
@@ -86,7 +84,7 @@ void BrowserActionButton::LoadImage() {
// Load the default image from the browser action asynchronously on the file
// thread. We'll get a call back into OnImageLoaded if the image loads
// successfully.
- std::string relative_path = browser_action()->GetDefaultIconPath();
+ std::string relative_path = browser_action()->default_icon_path();
if (relative_path.empty())
return;
@@ -98,7 +96,8 @@ void BrowserActionButton::LoadImage() {
}
void BrowserActionButton::OnImageLoaded(SkBitmap* image, size_t index) {
- SetIcon(*image);
+ if (image)
+ SetIcon(*image);
tracker_ = NULL; // The tracker object will delete itself when we return.
GetParent()->SchedulePaint();
}
@@ -211,11 +210,7 @@ void BrowserActionView::PaintChildren(gfx::Canvas* canvas) {
if (tab_id < 0)
return;
- ExtensionActionState::PaintBadge(
- canvas, gfx::Rect(width(), height()),
- action->GetBadgeText(tab_id),
- action->GetBadgeTextColor(tab_id),
- action->GetBadgeBackgroundColor(tab_id));
+ action->PaintBadge(canvas, gfx::Rect(width(), height()), tab_id);
}

Powered by Google App Engine
This is Rietveld 408576698