OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/extension_action.h" | 5 #include "chrome/browser/extensions/extension_action.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 void ExtensionAction::ClearAllValuesForTab(int tab_id) { | 166 void ExtensionAction::ClearAllValuesForTab(int tab_id) { |
167 popup_url_.erase(tab_id); | 167 popup_url_.erase(tab_id); |
168 title_.erase(tab_id); | 168 title_.erase(tab_id); |
169 icon_.erase(tab_id); | 169 icon_.erase(tab_id); |
170 badge_text_.erase(tab_id); | 170 badge_text_.erase(tab_id); |
171 badge_text_color_.erase(tab_id); | 171 badge_text_color_.erase(tab_id); |
172 badge_background_color_.erase(tab_id); | 172 badge_background_color_.erase(tab_id); |
173 is_visible_.erase(tab_id); | 173 is_visible_.erase(tab_id); |
174 // TODO(jyasskin): Erase the element from declarative_show_count_ | 174 // TODO(jyasskin): Erase the element from declarative_show_count_ |
175 // when the tab's closed. There's a race between the | 175 // when the tab's closed. There's a race between the |
176 // PageActionController and the ContentRulesRegistry on navigation, | 176 // LocationBarController and the ContentRulesRegistry on navigation, |
177 // which prevents me from cleaning everything up now. | 177 // which prevents me from cleaning everything up now. |
178 } | 178 } |
179 | 179 |
180 void ExtensionAction::PaintBadge(gfx::Canvas* canvas, | 180 void ExtensionAction::PaintBadge(gfx::Canvas* canvas, |
181 const gfx::Rect& bounds, | 181 const gfx::Rect& bounds, |
182 int tab_id) { | 182 int tab_id) { |
183 badge_util::PaintBadge( | 183 badge_util::PaintBadge( |
184 canvas, | 184 canvas, |
185 bounds, | 185 bounds, |
186 GetBadgeText(tab_id), | 186 GetBadgeText(tab_id), |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // If there is a default icon, the icon width will be set depending on our | 245 // If there is a default icon, the icon width will be set depending on our |
246 // action type. | 246 // action type. |
247 if (default_icon_) | 247 if (default_icon_) |
248 return GetIconSizeForType(action_type()); | 248 return GetIconSizeForType(action_type()); |
249 | 249 |
250 // If no icon has been set and there is no default icon, we need favicon | 250 // If no icon has been set and there is no default icon, we need favicon |
251 // width. | 251 // width. |
252 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 252 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
253 IDR_EXTENSIONS_FAVICON).ToImageSkia()->width(); | 253 IDR_EXTENSIONS_FAVICON).ToImageSkia()->width(); |
254 } | 254 } |
OLD | NEW |