| Index: chrome/browser/extensions/api/omnibox/omnibox_api.h
|
| diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.h b/chrome/browser/extensions/api/omnibox/omnibox_api.h
|
| index ee195d435eb71ece41cb7531be2f75a0f5bfe3e7..5beb728e8193baa8c7a1c294f1cd1b792c98cc6c 100644
|
| --- a/chrome/browser/extensions/api/omnibox/omnibox_api.h
|
| +++ b/chrome/browser/extensions/api/omnibox/omnibox_api.h
|
| @@ -12,6 +12,10 @@
|
| #include "base/string16.h"
|
| #include "chrome/browser/autocomplete/autocomplete_match.h"
|
| #include "chrome/browser/extensions/extension_function.h"
|
| +#include "chrome/browser/extensions/extension_icon_manager.h"
|
| +#include "chrome/browser/profiles/profile_keyed_service.h"
|
| +#include "content/public/browser/notification_observer.h"
|
| +#include "content/public/browser/notification_registrar.h"
|
|
|
| class TemplateURL;
|
|
|
| @@ -23,6 +27,10 @@ namespace content {
|
| class WebContents;
|
| }
|
|
|
| +namespace gfx {
|
| +class Image;
|
| +}
|
| +
|
| namespace extensions {
|
|
|
| // Event router class for events related to the omnibox API.
|
| @@ -67,6 +75,46 @@ class OmniboxSendSuggestionsFunction : public SyncExtensionFunction {
|
| virtual bool RunImpl() OVERRIDE;
|
| };
|
|
|
| +class OmniboxAPI : public ProfileKeyedService,
|
| + public content::NotificationObserver {
|
| + public:
|
| + explicit OmniboxAPI(Profile* profile);
|
| + virtual ~OmniboxAPI();
|
| +
|
| + // ProfileKeyedService implementation.
|
| + virtual void Shutdown() OVERRIDE;
|
| +
|
| + // Convenience method to get the OmniboxAPI for a profile.
|
| + static OmniboxAPI* Get(Profile* profile);
|
| +
|
| + // content::NotificationObserver implementation.
|
| + virtual void Observe(int type,
|
| + const content::NotificationSource& source,
|
| + const content::NotificationDetails& details) OVERRIDE;
|
| +
|
| + // Returns the icon to display in the omnibox for the given extension.
|
| + gfx::Image GetOmniboxIcon(const std::string& extension_id);
|
| +
|
| + // Returns the icon to display in the omnibox popup window for the given
|
| + // extension.
|
| + gfx::Image GetOmniboxPopupIcon(const std::string& extension_id);
|
| +
|
| + // Returns the omnibox keyword for the extension.
|
| + static const std::string& GetKeyword(const Extension* extension);
|
| +
|
| + // Returns true if the extension needs a verbose install message.
|
| + // TODO(yoz): This should be associated with page actions, not
|
| + // the omnibox.
|
| + static bool IsVerboseInstallMessage(const Extension* extension);
|
| +
|
| + private:
|
| + content::NotificationRegistrar registrar_;
|
| +
|
| + // Keeps track of favicon-sized omnibox icons for extensions.
|
| + ExtensionIconManager omnibox_icon_manager_;
|
| + ExtensionIconManager omnibox_popup_icon_manager_;
|
| +};
|
| +
|
| class OmniboxSetDefaultSuggestionFunction : public SyncExtensionFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION_NAME("omnibox.setDefaultSuggestion");
|
|
|