OLD | NEW |
(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 } |
OLD | NEW |