Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_UNINSTALL_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 virtual void ExtensionUninstallCanceled() = 0; | 36 virtual void ExtensionUninstallCanceled() = 0; |
| 37 | 37 |
| 38 protected: | 38 protected: |
| 39 virtual ~Delegate() {} | 39 virtual ~Delegate() {} |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 // Creates a platform specific implementation of ExtensionUninstallDialog. The | 42 // Creates a platform specific implementation of ExtensionUninstallDialog. The |
| 43 // dialog will be modal to |parent|, or a non-modal dialog if |parent| is | 43 // dialog will be modal to |parent|, or a non-modal dialog if |parent| is |
| 44 // NULL. | 44 // NULL. |
| 45 static ExtensionUninstallDialog* Create(Profile* profile, | 45 static ExtensionUninstallDialog* Create(Profile* profile, |
| 46 gfx::NativeWindow parent, | 46 gfx::NativeWindow parent, |
|
Nico
2014/11/04 02:20:37
Shouldn't this parameter go away too now?
pkotwicz
2014/11/04 15:08:09
We use the parameter in the views implementation.
| |
| 47 Delegate* delegate); | 47 Delegate* delegate); |
| 48 | 48 |
| 49 virtual ~ExtensionUninstallDialog(); | 49 virtual ~ExtensionUninstallDialog(); |
| 50 | 50 |
| 51 // This is called to verify whether the uninstallation should proceed. | 51 // This is called to verify whether the uninstallation should proceed. |
| 52 // Starts the process of showing a confirmation UI, which is split into two. | 52 // Starts the process of showing a confirmation UI, which is split into two. |
| 53 // 1) Set off a 'load icon' task. | 53 // 1) Set off a 'load icon' task. |
| 54 // 2) Handle the load icon response and show the UI (OnImageLoaded). | 54 // 2) Handle the load icon response and show the UI (OnImageLoaded). |
| 55 void ConfirmUninstall(const Extension* extension); | 55 void ConfirmUninstall(const Extension* extension); |
| 56 | 56 |
| 57 // This shows the same dialog as above, except it also shows which extension | 57 // This shows the same dialog as above, except it also shows which extension |
| 58 // triggered the dialog by calling chrome.management.uninstall API. | 58 // triggered the dialog by calling chrome.management.uninstall API. |
| 59 void ConfirmProgrammaticUninstall(const Extension* extension, | 59 void ConfirmProgrammaticUninstall(const Extension* extension, |
| 60 const Extension* triggering_extension); | 60 const Extension* triggering_extension); |
| 61 | 61 |
| 62 std::string GetHeadingText(); | 62 std::string GetHeadingText(); |
| 63 | 63 |
| 64 protected: | 64 protected: |
| 65 // Constructor used by the derived classes. | 65 // Constructor used by the derived classes. |
| 66 ExtensionUninstallDialog(Profile* profile, | 66 ExtensionUninstallDialog(Profile* profile, Delegate* delegate); |
| 67 gfx::NativeWindow parent, | |
| 68 Delegate* delegate); | |
| 69 | 67 |
| 70 // TODO(sashab): Remove protected members: crbug.com/397395 | 68 // TODO(sashab): Remove protected members: crbug.com/397395 |
| 71 Profile* const profile_; | 69 Profile* const profile_; |
| 72 | 70 |
| 73 // TODO(sashab): Investigate lifetime issue of this window variable: | |
| 74 // crbug.com/397396 | |
| 75 gfx::NativeWindow parent_; | |
| 76 | |
| 77 // The delegate we will call Accepted/Canceled on after confirmation dialog. | 71 // The delegate we will call Accepted/Canceled on after confirmation dialog. |
| 78 Delegate* delegate_; | 72 Delegate* delegate_; |
| 79 | 73 |
| 80 // The extension we are showing the dialog for. | 74 // The extension we are showing the dialog for. |
| 81 const Extension* extension_; | 75 const Extension* extension_; |
| 82 | 76 |
| 83 // The extension triggering the dialog if the dialog was shown by | 77 // The extension triggering the dialog if the dialog was shown by |
| 84 // chrome.management.uninstall. | 78 // chrome.management.uninstall. |
| 85 const Extension* triggering_extension_; | 79 const Extension* triggering_extension_; |
| 86 | 80 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 99 virtual void Show() = 0; | 93 virtual void Show() = 0; |
| 100 | 94 |
| 101 base::MessageLoop* ui_loop_; | 95 base::MessageLoop* ui_loop_; |
| 102 | 96 |
| 103 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialog); | 97 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialog); |
| 104 }; | 98 }; |
| 105 | 99 |
| 106 } // namespace extensions | 100 } // namespace extensions |
| 107 | 101 |
| 108 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ | 102 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ |
| OLD | NEW |