OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INSTALL_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "chrome/browser/extensions/extension_install_ui.h" | 13 #include "chrome/browser/extensions/extension_install_ui.h" |
14 | 14 |
15 class Extension; | 15 class Extension; |
16 class Profile; | 16 class Profile; |
17 class SkBitmap; | 17 class SkBitmap; |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class DictionaryValue; | 20 class DictionaryValue; |
21 } | 21 } |
22 | 22 |
23 // The implementations of this function are platform-specific. | |
24 void ShowExtensionInstallDialog(Profile* profile, | 23 void ShowExtensionInstallDialog(Profile* profile, |
25 ExtensionInstallUI::Delegate* delegate, | 24 ExtensionInstallUI::Delegate* delegate, |
26 const Extension* extension, | 25 const Extension* extension, |
27 SkBitmap* icon, | 26 SkBitmap* icon, |
28 const ExtensionInstallUI::Prompt& prompt); | 27 const ExtensionInstallUI::Prompt& prompt); |
29 | 28 |
| 29 // The implementations of this function are platform-specific. |
| 30 void ShowExtensionInstallDialogImpl(Profile* profile, |
| 31 ExtensionInstallUI::Delegate* delegate, |
| 32 const Extension* extension, |
| 33 SkBitmap* icon, |
| 34 const ExtensionInstallUI::Prompt& prompt); |
| 35 |
30 // Wrapper around ShowExtensionInstallDialog that shows the install dialog for | 36 // Wrapper around ShowExtensionInstallDialog that shows the install dialog for |
31 // a given manifest (that corresponds to an extension about to be installed with | 37 // a given manifest (that corresponds to an extension about to be installed with |
32 // ID |id|). If the name or description in the manifest is a localized | 38 // ID |id|). If the name or description in the manifest is a localized |
33 // placeholder, it may be overidden with |localized_name| or | 39 // placeholder, it may be overidden with |localized_name| or |
34 // |localized_description| (which may be empty). The Extension instance | 40 // |localized_description| (which may be empty). The Extension instance |
35 // that's parsed is returned via |dummy_extension|. |prompt| should be fully | 41 // that's parsed is returned via |dummy_extension|. |prompt| should be fully |
36 // populated except for the permissions field, which will be extracted from the | 42 // populated except for the permissions field, which will be extracted from the |
37 // extension. | 43 // extension. |
38 // Returns true if |dummy_extension| is valid and delegate methods will be | 44 // Returns true if |dummy_extension| is valid and delegate methods will be |
39 // called. | 45 // called. |
40 bool ShowExtensionInstallDialogForManifest( | 46 bool ShowExtensionInstallDialogForManifest( |
41 Profile *profile, | 47 Profile *profile, |
42 ExtensionInstallUI::Delegate* delegate, | 48 ExtensionInstallUI::Delegate* delegate, |
43 const base::DictionaryValue* manifest, | 49 const base::DictionaryValue* manifest, |
44 const std::string& id, | 50 const std::string& id, |
45 const std::string& localized_name, | 51 const std::string& localized_name, |
46 const std::string& localized_description, | 52 const std::string& localized_description, |
47 SkBitmap* icon, | 53 SkBitmap* icon, |
48 const ExtensionInstallUI::Prompt& prompt, | 54 const ExtensionInstallUI::Prompt& prompt, |
49 scoped_refptr<Extension>* dummy_extension); | 55 scoped_refptr<Extension>* dummy_extension); |
50 | 56 |
51 // For use only in tests - sets a flag that makes invocations of | 57 // For use only in tests - sets a flag that makes invocations of |
52 // ShowExtensionInstallDialogForManifest skip putting up a real dialog, and | 58 // ShowExtensionInstallDialog* skip putting up a real dialog, and |
53 // instead act as if the dialog choice was to proceed or abort. | 59 // instead act as if the dialog choice was to proceed or abort. |
54 void SetExtensionInstallDialogForManifestAutoConfirmForTests( | 60 void SetExtensionInstallDialogAutoConfirmForTests( |
55 bool should_proceed); | 61 bool should_proceed); |
56 | 62 |
57 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG_H_ | 63 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG_H_ |
OLD | NEW |