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/string16.h" | 12 #include "base/string16.h" |
12 #include "chrome/browser/extensions/extension_install_ui.h" | 13 #include "chrome/browser/extensions/extension_install_ui.h" |
13 | 14 |
14 class Extension; | 15 class Extension; |
15 class Profile; | 16 class Profile; |
16 class SkBitmap; | 17 class SkBitmap; |
17 | 18 |
| 19 namespace base { |
| 20 class DictionaryValue; |
| 21 } |
| 22 |
18 // The implementations of this function are platform-specific. | 23 // The implementations of this function are platform-specific. |
19 void ShowExtensionInstallDialog(Profile* profile, | 24 void ShowExtensionInstallDialog(Profile* profile, |
20 ExtensionInstallUI::Delegate* delegate, | 25 ExtensionInstallUI::Delegate* delegate, |
21 const Extension* extension, | 26 const Extension* extension, |
22 SkBitmap* icon, | 27 SkBitmap* icon, |
23 const std::vector<string16>& permissions, | 28 const std::vector<string16>& permissions, |
24 ExtensionInstallUI::PromptType type); | 29 ExtensionInstallUI::PromptType type); |
25 | 30 |
| 31 // Wrapper around ShowExtensionInstallDialog that shows the install dialog for |
| 32 // a given manifest (that corresponds to an extension about to be installed with |
| 33 // ID |id|). If the name in the manifest is a localized placeholder, it may be |
| 34 // overidden with |localized_name| (which may be empty). The Extension instance |
| 35 // that's parsed is returned via |dummy_extension|. |
| 36 void ShowExtensionInstallDialogForManifest( |
| 37 Profile *profile, |
| 38 ExtensionInstallUI::Delegate* delegate, |
| 39 const base::DictionaryValue* manifest, |
| 40 const std::string& id, |
| 41 const std::string& localized_name, |
| 42 SkBitmap* icon, |
| 43 ExtensionInstallUI::PromptType type, |
| 44 scoped_refptr<Extension>* dummy_extension); |
| 45 |
| 46 // For use only in tests - sets a flag that makes invocations of |
| 47 // ShowExtensionInstallDialogForManifest skip putting up a real dialog, and |
| 48 // instead act as if the dialog choice was to proceed or abort. |
| 49 void SetExtensionInstallDialogForManifestAutoConfirmForTests( |
| 50 bool should_proceed); |
| 51 |
26 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG_H_ | 52 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG_H_ |
OLD | NEW |