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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // dialog. | 84 // dialog. |
85 void HandleReportAbuse(); | 85 void HandleReportAbuse(); |
86 | 86 |
87 // TODO(sashab): Remove protected members: crbug.com/397395 | 87 // TODO(sashab): Remove protected members: crbug.com/397395 |
88 Profile* const profile_; | 88 Profile* const profile_; |
89 | 89 |
90 // The delegate we will call Accepted/Canceled on after confirmation dialog. | 90 // The delegate we will call Accepted/Canceled on after confirmation dialog. |
91 Delegate* delegate_; | 91 Delegate* delegate_; |
92 | 92 |
93 // The extension we are showing the dialog for. | 93 // The extension we are showing the dialog for. |
94 const Extension* extension_; | 94 scoped_refptr<const Extension> extension_; |
95 | 95 |
96 // The extension triggering the dialog if the dialog was shown by | 96 // The extension triggering the dialog if the dialog was shown by |
97 // chrome.management.uninstall. | 97 // chrome.management.uninstall. |
98 const Extension* triggering_extension_; | 98 scoped_refptr<const Extension> triggering_extension_; |
99 | 99 |
100 // The extensions icon. | 100 // The extensions icon. |
101 gfx::ImageSkia icon_; | 101 gfx::ImageSkia icon_; |
102 | 102 |
103 private: | 103 private: |
104 // Sets the icon that will be used in the dialog. If |icon| contains an empty | 104 // Sets the icon that will be used in the dialog. If |icon| contains an empty |
105 // image, then we use a default icon instead. | 105 // image, then we use a default icon instead. |
106 void SetIcon(const gfx::Image& image); | 106 void SetIcon(const gfx::Image& image); |
107 | 107 |
108 void OnImageLoaded(const std::string& extension_id, const gfx::Image& image); | 108 void OnImageLoaded(const std::string& extension_id, const gfx::Image& image); |
109 | 109 |
110 // Displays the prompt. This should only be called after loading the icon. | 110 // Displays the prompt. This should only be called after loading the icon. |
111 // The implementations of this method are platform-specific. | 111 // The implementations of this method are platform-specific. |
112 virtual void Show() = 0; | 112 virtual void Show() = 0; |
113 | 113 |
114 base::MessageLoop* ui_loop_; | 114 base::MessageLoop* ui_loop_; |
115 | 115 |
116 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialog); | 116 DISALLOW_COPY_AND_ASSIGN(ExtensionUninstallDialog); |
117 }; | 117 }; |
118 | 118 |
119 } // namespace extensions | 119 } // namespace extensions |
120 | 120 |
121 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ | 121 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UNINSTALL_DIALOG_H_ |
OLD | NEW |