Chromium Code Reviews| Index: chrome/browser/extensions/api/management/management_api.h |
| =================================================================== |
| --- chrome/browser/extensions/api/management/management_api.h (revision 271412) |
| +++ chrome/browser/extensions/api/management/management_api.h (working copy) |
| @@ -6,9 +6,11 @@ |
| #define CHROME_BROWSER_EXTENSIONS_API_MANAGEMENT_MANAGEMENT_API_H_ |
| #include "base/compiler_specific.h" |
| +#include "base/task/cancelable_task_tracker.h" |
| #include "chrome/browser/extensions/chrome_extension_function.h" |
| #include "chrome/browser/extensions/extension_install_prompt.h" |
| #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| +#include "components/favicon_base/favicon_types.h" |
| #include "components/keyed_service/core/keyed_service.h" |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| @@ -189,6 +191,43 @@ |
| virtual bool RunAsync() OVERRIDE; |
| }; |
| +class ManagementGenerateAppForLinkFunction : public AsyncManagementFunction, |
| + public content::NotificationObserver { |
|
benwells
2014/05/22 02:49:25
This indentation looks wrong. Did you run git cl f
wjywbs
2014/05/22 03:21:35
Done.
|
| + public: |
| + DECLARE_EXTENSION_FUNCTION("management.generateAppForLink", |
| + MANAGEMENT_GENERATEAPPFORLINK); |
| + |
| + ManagementGenerateAppForLinkFunction(); |
| + |
| + protected: |
| + virtual ~ManagementGenerateAppForLinkFunction(); |
| + |
| + virtual bool RunAsync() OVERRIDE; |
| + |
| + private: |
| + struct AppInstallInfo { |
| + AppInstallInfo() {} |
| + ~AppInstallInfo() {} |
| + |
| + std::string title; |
| + GURL launch_url; |
| + }; |
| + |
| + void OnFaviconForApp(const favicon_base::FaviconImageResult& image_result); |
| + |
| + scoped_ptr<AppInstallInfo> install_info_; |
| + |
| + // Used for favicon loading tasks. |
| + base::CancelableTaskTracker cancelable_task_tracker_; |
| + |
| + // Overridden from content::NotificationObserver: |
|
benwells
2014/05/22 02:49:25
Methods should go before fields. Put this up after
wjywbs
2014/05/22 03:21:35
Done.
|
| + virtual void Observe(int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) OVERRIDE; |
| + |
| + content::NotificationRegistrar registrar_; |
| +}; |
| + |
| class ManagementEventRouter : public content::NotificationObserver { |
| public: |
| explicit ManagementEventRouter(Profile* profile); |