| 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 #import "chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.
h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.
h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 std::string error; | 35 std::string error; |
| 36 JSONFileValueSerializer serializer(path); | 36 JSONFileValueSerializer serializer(path); |
| 37 scoped_ptr<DictionaryValue> value(static_cast<DictionaryValue*>( | 37 scoped_ptr<DictionaryValue> value(static_cast<DictionaryValue*>( |
| 38 serializer.Deserialize(NULL, &error))); | 38 serializer.Deserialize(NULL, &error))); |
| 39 if (!value.get()) { | 39 if (!value.get()) { |
| 40 LOG(ERROR) << error; | 40 LOG(ERROR) << error; |
| 41 return extension; | 41 return extension; |
| 42 } | 42 } |
| 43 | 43 |
| 44 extension = Extension::Create(path.DirName(), Extension::INVALID, *value, | 44 extension = Extension::Create( |
| 45 Extension::NO_FLAGS, &error); | 45 path.DirName(), extensions::Manifest::INVALID_LOCATION, *value, |
| 46 Extension::NO_FLAGS, &error); |
| 46 if (!extension.get()) | 47 if (!extension.get()) |
| 47 LOG(ERROR) << error; | 48 LOG(ERROR) << error; |
| 48 | 49 |
| 49 return extension; | 50 return extension; |
| 50 } | 51 } |
| 51 | 52 |
| 52 gfx::Image LoadInstallPromptIcon() { | 53 gfx::Image LoadInstallPromptIcon() { |
| 53 FilePath path; | 54 FilePath path; |
| 54 PathService::Get(chrome::DIR_TEST_DATA, &path); | 55 PathService::Get(chrome::DIR_TEST_DATA, &path); |
| 55 path = path.AppendASCII("extensions") | 56 path = path.AppendASCII("extensions") |
| (...skipping 10 matching lines...) Expand all Loading... |
| 66 | 67 |
| 67 ExtensionInstallPrompt::Prompt BuildExtensionInstallPrompt( | 68 ExtensionInstallPrompt::Prompt BuildExtensionInstallPrompt( |
| 68 Extension* extension) { | 69 Extension* extension) { |
| 69 ExtensionInstallPrompt::Prompt prompt(ExtensionInstallPrompt::INSTALL_PROMPT); | 70 ExtensionInstallPrompt::Prompt prompt(ExtensionInstallPrompt::INSTALL_PROMPT); |
| 70 prompt.set_extension(extension); | 71 prompt.set_extension(extension); |
| 71 prompt.set_icon(LoadInstallPromptIcon()); | 72 prompt.set_icon(LoadInstallPromptIcon()); |
| 72 return prompt; | 73 return prompt; |
| 73 } | 74 } |
| 74 | 75 |
| 75 } // namespace chrome | 76 } // namespace chrome |
| OLD | NEW |