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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/operations/unmount.cc

Issue 547313002: [fsp] Use auto generated methods for generating dictionaries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/file_system_provider/operations/unmount.h" 5 #include "chrome/browser/chromeos/file_system_provider/operations/unmount.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/common/extensions/api/file_system_provider.h" 8 #include "chrome/common/extensions/api/file_system_provider.h"
9 9
10 namespace chromeos { 10 namespace chromeos {
11 namespace file_system_provider { 11 namespace file_system_provider {
12 namespace operations { 12 namespace operations {
13 13
14 Unmount::Unmount(extensions::EventRouter* event_router, 14 Unmount::Unmount(extensions::EventRouter* event_router,
15 const ProvidedFileSystemInfo& file_system_info, 15 const ProvidedFileSystemInfo& file_system_info,
16 const storage::AsyncFileUtil::StatusCallback& callback) 16 const storage::AsyncFileUtil::StatusCallback& callback)
17 : Operation(event_router, file_system_info), callback_(callback) { 17 : Operation(event_router, file_system_info), callback_(callback) {
18 } 18 }
19 19
20 Unmount::~Unmount() { 20 Unmount::~Unmount() {
21 } 21 }
22 22
23 bool Unmount::Execute(int request_id) { 23 bool Unmount::Execute(int request_id) {
24 scoped_ptr<base::DictionaryValue> values(new base::DictionaryValue); 24 using extensions::api::file_system_provider::UnmountRequestedOptions;
25
26 UnmountRequestedOptions options;
27 options.file_system_id = file_system_info_.file_system_id();
28 options.request_id = request_id;
29
25 return SendEvent( 30 return SendEvent(
26 request_id, 31 request_id,
27 extensions::api::file_system_provider::OnUnmountRequested::kEventName, 32 extensions::api::file_system_provider::OnUnmountRequested::kEventName,
28 values.Pass()); 33 extensions::api::file_system_provider::OnUnmountRequested::Create(
34 options));
29 } 35 }
30 36
31 void Unmount::OnSuccess(int /* request_id */, 37 void Unmount::OnSuccess(int /* request_id */,
32 scoped_ptr<RequestValue> /* result */, 38 scoped_ptr<RequestValue> /* result */,
33 bool /* has_more */) { 39 bool /* has_more */) {
34 callback_.Run(base::File::FILE_OK); 40 callback_.Run(base::File::FILE_OK);
35 } 41 }
36 42
37 void Unmount::OnError(int /* request_id */, 43 void Unmount::OnError(int /* request_id */,
38 scoped_ptr<RequestValue> /* result */, 44 scoped_ptr<RequestValue> /* result */,
39 base::File::Error error) { 45 base::File::Error error) {
40 callback_.Run(error); 46 callback_.Run(error);
41 } 47 }
42 48
43 } // namespace operations 49 } // namespace operations
44 } // namespace file_system_provider 50 } // namespace file_system_provider
45 } // namespace chromeos 51 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698