| 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/api/system_indicator/system_indicator_manage
r.h" | 5 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage
r.h" |
| 6 | 6 |
| 7 #include "base/memory/linked_ptr.h" | 7 #include "base/memory/linked_ptr.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/extensions/extension_action.h" | 10 #include "chrome/browser/extensions/extension_action.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/extensions/extension_system.h" | |
| 13 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/status_icons/status_icon.h" | 13 #include "chrome/browser/status_icons/status_icon.h" |
| 15 #include "chrome/browser/status_icons/status_icon_observer.h" | 14 #include "chrome/browser/status_icons/status_icon_observer.h" |
| 16 #include "chrome/browser/status_icons/status_tray.h" | 15 #include "chrome/browser/status_icons/status_tray.h" |
| 17 #include "chrome/common/extensions/api/system_indicator.h" | 16 #include "chrome/common/extensions/api/system_indicator.h" |
| 18 #include "content/public/browser/notification_details.h" | 17 #include "content/public/browser/notification_details.h" |
| 19 #include "content/public/browser/notification_source.h" | 18 #include "content/public/browser/notification_source.h" |
| 20 #include "extensions/browser/event_router.h" | 19 #include "extensions/browser/event_router.h" |
| 20 #include "extensions/browser/extension_system.h" |
| 21 #include "extensions/common/extension.h" | 21 #include "extensions/common/extension.h" |
| 22 #include "ui/gfx/image/image.h" | 22 #include "ui/gfx/image/image.h" |
| 23 | 23 |
| 24 namespace extensions { | 24 namespace extensions { |
| 25 | 25 |
| 26 namespace system_indicator = api::system_indicator; | 26 namespace system_indicator = api::system_indicator; |
| 27 | 27 |
| 28 // Observes clicks on a given status icon and forwards the event to the | 28 // Observes clicks on a given status icon and forwards the event to the |
| 29 // appropriate extension. Handles icon updates, and responsible for creating | 29 // appropriate extension. Handles icon updates, and responsible for creating |
| 30 // and removing the icon from the notification area during construction and | 30 // and removing the icon from the notification area during construction and |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 if (extension_icon) | 202 if (extension_icon) |
| 203 system_indicators_[extension->id()] = make_linked_ptr(extension_icon); | 203 system_indicators_[extension->id()] = make_linked_ptr(extension_icon); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void SystemIndicatorManager::RemoveIndicator(const std::string& extension_id) { | 206 void SystemIndicatorManager::RemoveIndicator(const std::string& extension_id) { |
| 207 DCHECK(thread_checker_.CalledOnValidThread()); | 207 DCHECK(thread_checker_.CalledOnValidThread()); |
| 208 system_indicators_.erase(extension_id); | 208 system_indicators_.erase(extension_id); |
| 209 } | 209 } |
| 210 | 210 |
| 211 } // namespace extensions | 211 } // namespace extensions |
| OLD | NEW |