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

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

Issue 306044: Refactor implementation of BrowserActions, and add support for (Closed)
Patch Set: Make it work on linux too 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/common/extensions/extension_action2.cc
diff --git a/chrome/common/extensions/extension_action2.cc b/chrome/common/extensions/extension_action2.cc
new file mode 100755
index 0000000000000000000000000000000000000000..653de950d5e5ab29876f4992681eb8c085b152dc
--- /dev/null
+++ b/chrome/common/extensions/extension_action2.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// 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_action2.h"
+
+#include "base/logging.h"
+
+const int ExtensionAction2::kDefaultTabId = -1;
+
+void ExtensionAction2::SetDefaultIcon(const std::string& path) {
+ default_icon_path_ = path;
+ icon_.erase(kDefaultTabId);
+}
+
+void ExtensionAction2::SetDefaultIcon(int icon_index) {
+ if (static_cast<size_t>(icon_index) >= icon_paths_.size()) {
+ NOTREACHED();
+ return;
+ }
+
+ SetDefaultIcon(icon_paths_[icon_index]);
+}
+
+void ExtensionAction2::ClearAllValuesForTab(int tab_id) {
+ title_.erase(tab_id);
+ icon_.erase(tab_id);
+ badge_text_.erase(tab_id);
+ badge_background_color_.erase(tab_id);
+ badge_text_color_.erase(tab_id);
+}
« no previous file with comments | « chrome/common/extensions/extension_action2.h ('k') | chrome/common/extensions/extension_action2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698