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

Unified Diff: chrome/common/extensions/extension_action.cc

Issue 337035: Replace ExtensionAction with ExtensionAction2. (Closed)
Patch Set: Remove todo 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
« no previous file with comments | « chrome/common/extensions/extension_action.h ('k') | chrome/common/extensions/extension_action2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_action.cc
diff --git a/chrome/common/extensions/extension_action.cc b/chrome/common/extensions/extension_action.cc
old mode 100644
new mode 100755
index 246961f1a3410ee0719713641df3546c9b53095c..2ff2f6029449ef393ae23d315472f402f582bbf2
--- a/chrome/common/extensions/extension_action.cc
+++ b/chrome/common/extensions/extension_action.cc
@@ -2,31 +2,39 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/common/extensions/extension_action.h"
+
#include "app/gfx/canvas.h"
#include "app/resource_bundle.h"
#include "base/gfx/rect.h"
#include "chrome/app/chrome_dll_resource.h"
-#include "chrome/common/extensions/extension_action.h"
#include "grit/app_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkTypeface.h"
#include "third_party/skia/include/effects/SkGradientShader.h"
-ExtensionAction::ExtensionAction()
- : type_(PAGE_ACTION) {
-}
+const int ExtensionAction::kDefaultTabId = -1;
-ExtensionAction::~ExtensionAction() {
+void ExtensionAction::ClearAllValuesForTab(int tab_id) {
+ title_.erase(tab_id);
+ icon_.erase(tab_id);
+ icon_index_.erase(tab_id);
+ badge_text_.erase(tab_id);
+ badge_text_color_.erase(tab_id);
+ badge_background_color_.erase(tab_id);
+ visible_.erase(tab_id);
}
-void ExtensionActionState::PaintBadge(gfx::Canvas* canvas,
- const gfx::Rect& bounds,
- const std::string& text,
- SkColor text_color,
- SkColor background_color) {
+void ExtensionAction::PaintBadge(gfx::Canvas* canvas,
+ const gfx::Rect& bounds,
+ int tab_id) {
+ std::string text = GetBadgeText(tab_id);
if (text.empty())
return;
+ SkColor text_color = GetBadgeTextColor(tab_id);
+ SkColor background_color = GetBadgeBackgroundColor(tab_id);
+
if (SkColorGetA(text_color) == 0x00)
text_color = SK_ColorWHITE;
« no previous file with comments | « chrome/common/extensions/extension_action.h ('k') | chrome/common/extensions/extension_action2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698