| 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_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 void ShowExtensionInstallDialog(Profile* profile, | 23 void ShowExtensionInstallDialog(Profile* profile, |
| 24 ExtensionInstallUI::Delegate* delegate, | 24 ExtensionInstallUI::Delegate* delegate, |
| 25 const Extension* extension, | |
| 26 SkBitmap* icon, | |
| 27 const ExtensionInstallUI::Prompt& prompt); | 25 const ExtensionInstallUI::Prompt& prompt); |
| 28 | 26 |
| 29 // The implementations of this function are platform-specific. | 27 // The implementations of this function are platform-specific. |
| 30 void ShowExtensionInstallDialogImpl(Profile* profile, | 28 void ShowExtensionInstallDialogImpl(Profile* profile, |
| 31 ExtensionInstallUI::Delegate* delegate, | 29 ExtensionInstallUI::Delegate* delegate, |
| 32 const Extension* extension, | |
| 33 SkBitmap* icon, | |
| 34 const ExtensionInstallUI::Prompt& prompt); | 30 const ExtensionInstallUI::Prompt& prompt); |
| 35 | 31 |
| 36 // Wrapper around ShowExtensionInstallDialog that shows the install dialog for | 32 // Wrapper around ShowExtensionInstallDialog that shows the install dialog for |
| 37 // a given manifest (that corresponds to an extension about to be installed with | 33 // a given manifest (that corresponds to an extension about to be installed with |
| 38 // ID |id|). If the name or description in the manifest is a localized | 34 // ID |id|). If the name or description in the manifest is a localized |
| 39 // placeholder, it may be overidden with |localized_name| or | 35 // placeholder, it may be overidden with |localized_name| or |
| 40 // |localized_description| (which may be empty). The Extension instance | 36 // |localized_description| (which may be empty). The Extension instance |
| 41 // that's parsed is returned via |dummy_extension|. |prompt| should be fully | 37 // that's parsed is returned via |dummy_extension|. |prompt| should be fully |
| 42 // populated except for the permissions field, which will be extracted from the | 38 // populated except for the permissions field, which will be extracted from the |
| 43 // extension. | 39 // extension. |
| 44 // Returns true if |dummy_extension| is valid and delegate methods will be | 40 // Returns true if |dummy_extension| is valid and delegate methods will be |
| 45 // called. | 41 // called. |
| 46 bool ShowExtensionInstallDialogForManifest( | 42 bool ShowExtensionInstallDialogForManifest( |
| 47 Profile *profile, | 43 Profile *profile, |
| 48 ExtensionInstallUI::Delegate* delegate, | 44 ExtensionInstallUI::Delegate* delegate, |
| 49 const base::DictionaryValue* manifest, | 45 const base::DictionaryValue* manifest, |
| 50 const std::string& id, | 46 const std::string& id, |
| 51 const std::string& localized_name, | 47 const std::string& localized_name, |
| 52 const std::string& localized_description, | 48 const std::string& localized_description, |
| 53 SkBitmap* icon, | 49 SkBitmap* icon, |
| 54 const ExtensionInstallUI::Prompt& prompt, | 50 const ExtensionInstallUI::Prompt& prompt, |
| 55 scoped_refptr<Extension>* dummy_extension); | 51 scoped_refptr<Extension>* dummy_extension); |
| 56 | 52 |
| 57 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG_H_ | 53 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_DIALOG_H_ |
| OLD | NEW |