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_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 .AppendASCII("icon.png"); | 64 .AppendASCII("icon.png"); |
65 | 65 |
66 std::string file_contents; | 66 std::string file_contents; |
67 base::ReadFileToString(path, &file_contents); | 67 base::ReadFileToString(path, &file_contents); |
68 | 68 |
69 return gfx::Image::CreateFrom1xPNGBytes( | 69 return gfx::Image::CreateFrom1xPNGBytes( |
70 reinterpret_cast<const unsigned char*>(file_contents.c_str()), | 70 reinterpret_cast<const unsigned char*>(file_contents.c_str()), |
71 file_contents.length()); | 71 file_contents.length()); |
72 } | 72 } |
73 | 73 |
74 ExtensionInstallPrompt::Prompt BuildExtensionInstallPrompt( | 74 scoped_refptr<ExtensionInstallPrompt::Prompt> BuildExtensionInstallPrompt( |
75 Extension* extension) { | 75 Extension* extension) { |
76 ExtensionInstallPrompt::Prompt prompt(ExtensionInstallPrompt::INSTALL_PROMPT); | 76 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt = |
77 prompt.set_extension(extension); | 77 new ExtensionInstallPrompt::Prompt( |
78 prompt.set_icon(LoadInstallPromptIcon()); | 78 ExtensionInstallPrompt::INSTALL_PROMPT); |
| 79 prompt->set_extension(extension); |
| 80 prompt->set_icon(LoadInstallPromptIcon()); |
79 return prompt; | 81 return prompt; |
80 } | 82 } |
81 | 83 |
82 ExtensionInstallPrompt::Prompt BuildExtensionPostInstallPermissionsPrompt( | 84 scoped_refptr<ExtensionInstallPrompt::Prompt> |
83 Extension* extension) { | 85 BuildExtensionPostInstallPermissionsPrompt(Extension* extension) { |
84 ExtensionInstallPrompt::Prompt prompt( | 86 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt = |
85 ExtensionInstallPrompt::POST_INSTALL_PERMISSIONS_PROMPT); | 87 new ExtensionInstallPrompt::Prompt( |
86 prompt.set_extension(extension); | 88 ExtensionInstallPrompt::POST_INSTALL_PERMISSIONS_PROMPT); |
87 prompt.set_icon(LoadInstallPromptIcon()); | 89 prompt->set_extension(extension); |
| 90 prompt->set_icon(LoadInstallPromptIcon()); |
88 return prompt; | 91 return prompt; |
89 } | 92 } |
90 | 93 |
91 } // namespace chrome | 94 } // namespace chrome |
OLD | NEW |