Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: chrome/browser/extensions/extension_management_api.h

Issue 10388252: Refactoring ExtenionInstallUI to abstract the Browser references. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced + mac fix Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "chrome/browser/extensions/extension_function.h" 10 #include "chrome/browser/extensions/extension_function.h"
11 #include "chrome/browser/extensions/extension_install_ui.h" 11 #include "chrome/browser/extensions/extension_install_prompt.h"
12 #include "chrome/browser/extensions/extension_uninstall_dialog.h" 12 #include "chrome/browser/extensions/extension_uninstall_dialog.h"
13 #include "content/public/browser/notification_observer.h" 13 #include "content/public/browser/notification_observer.h"
14 #include "content/public/browser/notification_registrar.h" 14 #include "content/public/browser/notification_registrar.h"
15 15
16 class ExtensionService; 16 class ExtensionService;
17 class ExtensionUninstallDialog; 17 class ExtensionUninstallDialog;
18 18
19 class ExtensionManagementFunction : public SyncExtensionFunction { 19 class ExtensionManagementFunction : public SyncExtensionFunction {
20 protected: 20 protected:
21 virtual ~ExtensionManagementFunction() {} 21 virtual ~ExtensionManagementFunction() {}
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 DECLARE_EXTENSION_FUNCTION_NAME("management.launchApp"); 84 DECLARE_EXTENSION_FUNCTION_NAME("management.launchApp");
85 85
86 protected: 86 protected:
87 virtual ~LaunchAppFunction() {} 87 virtual ~LaunchAppFunction() {}
88 88
89 // ExtensionFunction: 89 // ExtensionFunction:
90 virtual bool RunImpl() OVERRIDE; 90 virtual bool RunImpl() OVERRIDE;
91 }; 91 };
92 92
93 class SetEnabledFunction : public AsyncExtensionManagementFunction, 93 class SetEnabledFunction : public AsyncExtensionManagementFunction,
94 public ExtensionInstallUI::Delegate { 94 public ExtensionInstallPrompt::Delegate {
95 public: 95 public:
96 DECLARE_EXTENSION_FUNCTION_NAME("management.setEnabled"); 96 DECLARE_EXTENSION_FUNCTION_NAME("management.setEnabled");
97 97
98 SetEnabledFunction(); 98 SetEnabledFunction();
99 99
100 protected: 100 protected:
101 virtual ~SetEnabledFunction(); 101 virtual ~SetEnabledFunction();
102 102
103 // ExtensionFunction: 103 // ExtensionFunction:
104 virtual bool RunImpl() OVERRIDE; 104 virtual bool RunImpl() OVERRIDE;
105 105
106 // ExtensionInstallUI::Delegate. 106 // ExtensionInstallPrompt::Delegate.
107 virtual void InstallUIProceed() OVERRIDE; 107 virtual void InstallUIProceed() OVERRIDE;
108 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; 108 virtual void InstallUIAbort(bool user_initiated) OVERRIDE;
109 109
110 private: 110 private:
111 std::string extension_id_; 111 std::string extension_id_;
112 112
113 // Used for prompting to re-enable items with permissions escalation updates. 113 // Used for prompting to re-enable items with permissions escalation updates.
114 scoped_ptr<ExtensionInstallUI> install_ui_; 114 scoped_ptr<ExtensionInstallPrompt> install_prompt_;
115 }; 115 };
116 116
117 class UninstallFunction : public AsyncExtensionManagementFunction, 117 class UninstallFunction : public AsyncExtensionManagementFunction,
118 public ExtensionUninstallDialog::Delegate { 118 public ExtensionUninstallDialog::Delegate {
119 public: 119 public:
120 DECLARE_EXTENSION_FUNCTION_NAME("management.uninstall"); 120 DECLARE_EXTENSION_FUNCTION_NAME("management.uninstall");
121 121
122 UninstallFunction(); 122 UninstallFunction();
123 static void SetAutoConfirmForTest(bool should_proceed); 123 static void SetAutoConfirmForTest(bool should_proceed);
124 124
(...skipping 29 matching lines...) Expand all
154 const content::NotificationDetails& details) OVERRIDE; 154 const content::NotificationDetails& details) OVERRIDE;
155 155
156 content::NotificationRegistrar registrar_; 156 content::NotificationRegistrar registrar_;
157 157
158 Profile* profile_; 158 Profile* profile_;
159 159
160 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementEventRouter); 160 DISALLOW_COPY_AND_ASSIGN(ExtensionManagementEventRouter);
161 }; 161 };
162 162
163 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__ 163 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_H__
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_install_ui_default.cc ('k') | chrome/browser/extensions/extension_management_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698