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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/common/extensions/extension_action2.h"
6
7 #include "base/logging.h"
8
9 const int ExtensionAction2::kDefaultTabId = -1;
10
11 void ExtensionAction2::SetDefaultIcon(const std::string& path) {
12 default_icon_path_ = path;
13 icon_.erase(kDefaultTabId);
14 }
15
16 void ExtensionAction2::SetDefaultIcon(int icon_index) {
17 if (static_cast<size_t>(icon_index) >= icon_paths_.size()) {
18 NOTREACHED();
19 return;
20 }
21
22 SetDefaultIcon(icon_paths_[icon_index]);
23 }
24
25 void ExtensionAction2::ClearAllValuesForTab(int tab_id) {
26 title_.erase(tab_id);
27 icon_.erase(tab_id);
28 badge_text_.erase(tab_id);
29 badge_background_color_.erase(tab_id);
30 badge_text_color_.erase(tab_id);
31 }
OLDNEW
« 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