Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.mm

Issue 1534123002: [Extensions] Migrate ExtensionInstallPrompt::Delegate to be a callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/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"
11 #include "chrome/common/chrome_paths.h" 11 #include "chrome/common/chrome_paths.h"
12 #include "extensions/common/extension.h" 12 #include "extensions/common/extension.h"
13 13
14 using extensions::Extension; 14 using extensions::Extension;
15 15
16 namespace chrome { 16 namespace chrome {
17 17
18 void MockExtensionInstallPromptDelegate::InstallUIProceed() {
19 ++proceed_count_;
20 }
21
22 void MockExtensionInstallPromptDelegate::InstallUIAbort(bool user_initiated) {
23 ++abort_count_;
24 }
25
26 scoped_refptr<extensions::Extension> LoadInstallPromptExtension( 18 scoped_refptr<extensions::Extension> LoadInstallPromptExtension(
27 const char* extension_dir_name, 19 const char* extension_dir_name,
28 const char* manifest_file) { 20 const char* manifest_file) {
29 scoped_refptr<Extension> extension; 21 scoped_refptr<Extension> extension;
30 22
31 base::FilePath path; 23 base::FilePath path;
32 PathService::Get(chrome::DIR_TEST_DATA, &path); 24 PathService::Get(chrome::DIR_TEST_DATA, &path);
33 path = path.AppendASCII("extensions") 25 path = path.AppendASCII("extensions")
34 .AppendASCII(extension_dir_name) 26 .AppendASCII(extension_dir_name)
35 .AppendASCII(manifest_file); 27 .AppendASCII(manifest_file);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 BuildExtensionPostInstallPermissionsPrompt(Extension* extension) { 77 BuildExtensionPostInstallPermissionsPrompt(Extension* extension) {
86 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt( 78 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt(
87 new ExtensionInstallPrompt::Prompt( 79 new ExtensionInstallPrompt::Prompt(
88 ExtensionInstallPrompt::POST_INSTALL_PERMISSIONS_PROMPT)); 80 ExtensionInstallPrompt::POST_INSTALL_PERMISSIONS_PROMPT));
89 prompt->set_extension(extension); 81 prompt->set_extension(extension);
90 prompt->set_icon(LoadInstallPromptIcon()); 82 prompt->set_icon(LoadInstallPromptIcon());
91 return prompt.Pass(); 83 return prompt.Pass();
92 } 84 }
93 85
94 } // namespace chrome 86 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698