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/script_badge_controller.h" | 5 #include "chrome/browser/extensions/script_badge_controller.h" |
6 | 6 |
7 #include "chrome/browser/extensions/browser_event_router.h" | 7 #include "chrome/browser/extensions/browser_event_router.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
10 #include "chrome/browser/extensions/tab_helper.h" | 10 #include "chrome/browser/extensions/tab_helper.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 current_actions_.push_back(script_badge); | 179 current_actions_.push_back(script_badge); |
180 return script_badge; | 180 return script_badge; |
181 } | 181 } |
182 | 182 |
183 bool ScriptBadgeController::MarkExtensionExecuting( | 183 bool ScriptBadgeController::MarkExtensionExecuting( |
184 const std::string& extension_id) { | 184 const std::string& extension_id) { |
185 ExtensionAction* script_badge = AddExtensionToCurrentActions(extension_id); | 185 ExtensionAction* script_badge = AddExtensionToCurrentActions(extension_id); |
186 if (!script_badge) | 186 if (!script_badge) |
187 return false; | 187 return false; |
188 | 188 |
| 189 script_badge->SetIsVisible(SessionID::IdForTab(tab_contents_), true); |
189 script_badge->RunIconAnimation(SessionID::IdForTab(tab_contents_)); | 190 script_badge->RunIconAnimation(SessionID::IdForTab(tab_contents_)); |
190 | 191 |
191 return true; | 192 return true; |
192 } | 193 } |
193 | 194 |
194 bool ScriptBadgeController::EraseExtension(const Extension* extension) { | 195 bool ScriptBadgeController::EraseExtension(const Extension* extension) { |
195 if (extensions_in_current_actions_.erase(extension->id()) == 0) | 196 if (extensions_in_current_actions_.erase(extension->id()) == 0) |
196 return false; | 197 return false; |
197 | 198 |
198 size_t size_before = current_actions_.size(); | 199 size_t size_before = current_actions_.size(); |
(...skipping 10 matching lines...) Expand all Loading... |
209 current_actions_.erase(it); | 210 current_actions_.erase(it); |
210 break; | 211 break; |
211 } | 212 } |
212 } | 213 } |
213 | 214 |
214 CHECK_EQ(size_before, current_actions_.size() + 1); | 215 CHECK_EQ(size_before, current_actions_.size() + 1); |
215 return true; | 216 return true; |
216 } | 217 } |
217 | 218 |
218 } // namespace extensions | 219 } // namespace extensions |
OLD | NEW |