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

Side by Side Diff: chrome/browser/ui/extensions/extension_enable_flow.h

Issue 11644077: Put extension enable logic into a ExtensionEnableFlow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + address comments in #1 Created 7 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/ui/extensions/extension_enable_flow.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ENABLE_FLOW_H_
6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ENABLE_FLOW_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "chrome/browser/extensions/extension_install_prompt.h"
13
14 class ExtensionEnableFlowDelegate;
15
16 // ExtensionEnableFlow performs an UI flow to enable a disabled/terminated
17 // extension. It calls its delegate when enabling is done or is aborted.
18 // Callback on the delegate might be called synchronously if there is no
19 // permission change while the extension is disabled/terminated (or the
20 // extension is enabled already). Otherwise, a re-enable install prompt is
21 // shown to user. The extension is enabled when user acknowledges it or the
22 // flow is aborted when user declines it.
23 class ExtensionEnableFlow : public ExtensionInstallPrompt::Delegate {
24 public:
25 ExtensionEnableFlow(Profile* profile,
26 const std::string& extension_id,
27 ExtensionEnableFlowDelegate* delegate);
28 virtual ~ExtensionEnableFlow();
29
30 // Starts the flow and the logic continues on |delegate_| after enabling is
31 // finished or aborted.
32 void Start();
33
34 const std::string& extension_id() const { return extension_id_; }
35
36 private:
37 // ExtensionInstallPrompt::Delegate overrides:
38 virtual void InstallUIProceed() OVERRIDE;
39 virtual void InstallUIAbort(bool user_initiated) OVERRIDE;
40
41 Profile* const profile_;
42 const std::string extension_id_;
43 ExtensionEnableFlowDelegate* const delegate_; // Not owned.
44
45 scoped_ptr<ExtensionInstallPrompt> prompt_;
46
47 DISALLOW_COPY_AND_ASSIGN(ExtensionEnableFlow);
48 };
49
50 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ENABLE_FLOW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/extensions/extension_enable_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698