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/extension_browser_event_router.h" | 7 #include "chrome/browser/extensions/extension_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/extension_tab_helper.h" | 10 #include "chrome/browser/extensions/extension_tab_helper.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 bool success, | 75 bool success, |
76 int32 page_id, | 76 int32 page_id, |
77 const std::string& error) { | 77 const std::string& error) { |
78 if (success && page_id == GetPageID()) { | 78 if (success && page_id == GetPageID()) { |
79 if (InsertExtension(extension_id)) | 79 if (InsertExtension(extension_id)) |
80 NotifyChange(); | 80 NotifyChange(); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 ExtensionService* ScriptBadgeController::GetExtensionService() { | 84 ExtensionService* ScriptBadgeController::GetExtensionService() { |
85 return ExtensionSystem::Get(tab_contents_->profile())->extension_service(); | 85 return extensions::ExtensionSystem::Get( |
| 86 tab_contents_->profile())->extension_service(); |
86 } | 87 } |
87 | 88 |
88 int32 ScriptBadgeController::GetPageID() { | 89 int32 ScriptBadgeController::GetPageID() { |
89 return tab_contents_->web_contents()->GetController().GetActiveEntry()-> | 90 return tab_contents_->web_contents()->GetController().GetActiveEntry()-> |
90 GetPageID(); | 91 GetPageID(); |
91 } | 92 } |
92 | 93 |
93 void ScriptBadgeController::NotifyChange() { | 94 void ScriptBadgeController::NotifyChange() { |
94 content::NotificationService::current()->Notify( | 95 content::NotificationService::current()->Notify( |
95 chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED, | 96 chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 current_actions_.erase(it); | 178 current_actions_.erase(it); |
178 break; | 179 break; |
179 } | 180 } |
180 } | 181 } |
181 | 182 |
182 CHECK_EQ(size_before, current_actions_.size() + 1); | 183 CHECK_EQ(size_before, current_actions_.size() + 1); |
183 return true; | 184 return true; |
184 } | 185 } |
185 | 186 |
186 } // namespace extensions | 187 } // namespace extensions |
OLD | NEW |