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

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

Issue 329483002: [fsp] Group arguments for API methods and events in dictionaries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up. Created 6 years, 6 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 | Annotate | Revision Log
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/operation.h" 5 #include "chrome/browser/chromeos/file_system_provider/operations/operation.h"
6 6
7 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h" 7 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info .h"
8 #include "extensions/browser/event_router.h" 8 #include "extensions/browser/event_router.h"
9 9
10 namespace chromeos { 10 namespace chromeos {
(...skipping 26 matching lines...) Expand all
37 Operation::~Operation() { 37 Operation::~Operation() {
38 } 38 }
39 39
40 void Operation::SetDispatchEventImplForTesting( 40 void Operation::SetDispatchEventImplForTesting(
41 const DispatchEventImplCallback& callback) { 41 const DispatchEventImplCallback& callback) {
42 dispatch_event_impl_ = callback; 42 dispatch_event_impl_ = callback;
43 } 43 }
44 44
45 bool Operation::SendEvent(int request_id, 45 bool Operation::SendEvent(int request_id,
46 const std::string& event_name, 46 const std::string& event_name,
47 scoped_ptr<base::ListValue> event_args) { 47 scoped_ptr<base::DictionaryValue> options) {
48 event_args->Insert(0, 48 options->SetString("fileSystemId", file_system_info_.file_system_id());
49 new base::StringValue(file_system_info_.file_system_id())); 49 options->SetInteger("requestId", request_id);
50 event_args->Insert(1, new base::FundamentalValue(request_id)); 50
51 scoped_ptr<base::ListValue> event_args(new base::ListValue);
52 event_args->Append(options.release());
51 53
52 return dispatch_event_impl_.Run( 54 return dispatch_event_impl_.Run(
53 make_scoped_ptr(new extensions::Event(event_name, event_args.Pass()))); 55 make_scoped_ptr(new extensions::Event(event_name, event_args.Pass())));
54 } 56 }
55 57
56 } // namespace operations 58 } // namespace operations
57 } // namespace file_system_provider 59 } // namespace file_system_provider
58 } // namespace chromeos 60 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698