diff options
author | dewittj@chromium.org <dewittj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-17 22:10:49 +0000 |
---|---|---|
committer | dewittj@chromium.org <dewittj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-17 22:10:49 +0000 |
commit | f0eb58a08b934b3982956cb0a6b6e4c6274b3c6d (patch) | |
tree | f41bfbd32255c5cf810f4a6ff4a0e02eeb3f1224 /chrome/browser/extensions/extension_action_manager.cc | |
parent | 6561eef2828180ec55c8361d371a5d796e32e305 (diff) | |
download | chromium_src-f0eb58a08b934b3982956cb0a6b6e4c6274b3c6d.zip chromium_src-f0eb58a08b934b3982956cb0a6b6e4c6274b3c6d.tar.gz chromium_src-f0eb58a08b934b3982956cb0a6b6e4c6274b3c6d.tar.bz2 |
Add systray icon and click functionality to systemIndicator API.
The system tray will be the location of the system indicator icon for the Linux,
Mac OSX, and Windows OS (Vista and earlier). Yet to come is ChromeOS/Win7
taskbar integration, and Win8 integration.
BUG=142450
TBR=ben@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11445018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173551 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_action_manager.cc')
-rw-r--r-- | chrome/browser/extensions/extension_action_manager.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extension_action_manager.cc b/chrome/browser/extensions/extension_action_manager.cc index 8df52df..1632cdd2 100644 --- a/chrome/browser/extensions/extension_action_manager.cc +++ b/chrome/browser/extensions/extension_action_manager.cc @@ -4,6 +4,8 @@ #include "chrome/browser/extensions/extension_action_manager.h" +#include "chrome/browser/extensions/api/system_indicator/system_indicator_manager.h" +#include "chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h" #include "chrome/browser/extensions/extension_action.h" #include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/profiles/profile.h" @@ -55,7 +57,8 @@ ExtensionActionManagerFactory::GetInstance() { } // namespace -ExtensionActionManager::ExtensionActionManager(Profile* profile) { +ExtensionActionManager::ExtensionActionManager(Profile* profile) + : profile_(profile) { CHECK_EQ(profile, profile->GetOriginalProfile()) << "Don't instantiate this with an incognito profile."; registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, @@ -82,6 +85,7 @@ void ExtensionActionManager::Observe( page_actions_.erase(extension->id()); browser_actions_.erase(extension->id()); script_badges_.erase(extension->id()); + system_indicators_.erase(extension->id()); break; } } @@ -139,6 +143,13 @@ ExtensionAction* ExtensionActionManager::GetBrowserAction( ExtensionAction* ExtensionActionManager::GetSystemIndicator( const extensions::Extension& extension) const { + // If it does not already exist, create the SystemIndicatorManager for the + // given profile. This could return NULL if the system indicator area is + // unavailable on the current system. If so, return NULL to signal that + // the system indicator area is unusable. + if (!extensions::SystemIndicatorManagerFactory::GetForProfile(profile_)) + return NULL; + return GetOrCreateOrNull(&system_indicators_, extension.id(), Extension::ActionInfo::TYPE_SYSTEM_INDICATOR, extension.system_indicator_info()); |