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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/private_api_dialog.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h" 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" 9 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h"
10 #include "chrome/browser/ui/views/select_file_dialog_extension.h" 10 #include "chrome/browser/ui/views/select_file_dialog_extension.h"
(...skipping 18 matching lines...) Expand all
29 29
30 bool FileManagerPrivateCancelDialogFunction::RunAsync() { 30 bool FileManagerPrivateCancelDialogFunction::RunAsync() {
31 SelectFileDialogExtension::OnFileSelectionCanceled( 31 SelectFileDialogExtension::OnFileSelectionCanceled(
32 GetFileDialogRoutingID(this)); 32 GetFileDialogRoutingID(this));
33 SendResponse(true); 33 SendResponse(true);
34 return true; 34 return true;
35 } 35 }
36 36
37 bool FileManagerPrivateSelectFileFunction::RunAsync() { 37 bool FileManagerPrivateSelectFileFunction::RunAsync() {
38 using extensions::api::file_manager_private::SelectFile::Params; 38 using extensions::api::file_manager_private::SelectFile::Params;
39 const scoped_ptr<Params> params(Params::Create(*args_)); 39 const std::unique_ptr<Params> params(Params::Create(*args_));
40 EXTENSION_FUNCTION_VALIDATE(params); 40 EXTENSION_FUNCTION_VALIDATE(params);
41 41
42 std::vector<GURL> file_paths; 42 std::vector<GURL> file_paths;
43 file_paths.push_back(GURL(params->selected_path)); 43 file_paths.push_back(GURL(params->selected_path));
44 44
45 file_manager::util::GetSelectedFileInfoLocalPathOption option = 45 file_manager::util::GetSelectedFileInfoLocalPathOption option =
46 file_manager::util::NO_LOCAL_PATH_RESOLUTION; 46 file_manager::util::NO_LOCAL_PATH_RESOLUTION;
47 if (params->should_return_local_path) { 47 if (params->should_return_local_path) {
48 option = params->for_opening ? 48 option = params->for_opening ?
49 file_manager::util::NEED_LOCAL_PATH_FOR_OPENING : 49 file_manager::util::NEED_LOCAL_PATH_FOR_OPENING :
(...skipping 20 matching lines...) Expand all
70 SendResponse(false); 70 SendResponse(false);
71 return; 71 return;
72 } 72 }
73 SelectFileDialogExtension::OnFileSelected(GetFileDialogRoutingID(this), 73 SelectFileDialogExtension::OnFileSelected(GetFileDialogRoutingID(this),
74 files[0], index); 74 files[0], index);
75 SendResponse(true); 75 SendResponse(true);
76 } 76 }
77 77
78 bool FileManagerPrivateSelectFilesFunction::RunAsync() { 78 bool FileManagerPrivateSelectFilesFunction::RunAsync() {
79 using extensions::api::file_manager_private::SelectFiles::Params; 79 using extensions::api::file_manager_private::SelectFiles::Params;
80 const scoped_ptr<Params> params(Params::Create(*args_)); 80 const std::unique_ptr<Params> params(Params::Create(*args_));
81 EXTENSION_FUNCTION_VALIDATE(params); 81 EXTENSION_FUNCTION_VALIDATE(params);
82 82
83 std::vector<GURL> file_urls; 83 std::vector<GURL> file_urls;
84 for (size_t i = 0; i < params->selected_paths.size(); ++i) 84 for (size_t i = 0; i < params->selected_paths.size(); ++i)
85 file_urls.push_back(GURL(params->selected_paths[i])); 85 file_urls.push_back(GURL(params->selected_paths[i]));
86 86
87 file_manager::util::GetSelectedFileInfo( 87 file_manager::util::GetSelectedFileInfo(
88 render_frame_host(), 88 render_frame_host(),
89 GetProfile(), 89 GetProfile(),
90 file_urls, 90 file_urls,
(...skipping 13 matching lines...) Expand all
104 SendResponse(false); 104 SendResponse(false);
105 return; 105 return;
106 } 106 }
107 107
108 SelectFileDialogExtension::OnMultiFilesSelected(GetFileDialogRoutingID(this), 108 SelectFileDialogExtension::OnMultiFilesSelected(GetFileDialogRoutingID(this),
109 files); 109 files);
110 SendResponse(true); 110 SendResponse(true);
111 } 111 }
112 112
113 } // namespace extensions 113 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698