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

Side by Side Diff: chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc

Issue 14215009: Changed cloud print private API to pass all page settings as single object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 #include "chrome/browser/extensions/api/cloud_print_private/cloud_print_private_ api.h" 5 #include "chrome/browser/extensions/api/cloud_print_private/cloud_print_private_ api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/threading/sequenced_worker_pool.h" 9 #include "base/threading/sequenced_worker_pool.h"
10 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" 10 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
(...skipping 28 matching lines...) Expand all
39 39
40 40
41 bool CloudPrintPrivateSetupConnectorFunction::RunImpl() { 41 bool CloudPrintPrivateSetupConnectorFunction::RunImpl() {
42 using api::cloud_print_private::SetupConnector::Params; 42 using api::cloud_print_private::SetupConnector::Params;
43 scoped_ptr<Params> params(Params::Create(*args_)); 43 scoped_ptr<Params> params(Params::Create(*args_));
44 if (CloudPrintTestsDelegate::instance()) { 44 if (CloudPrintTestsDelegate::instance()) {
45 CloudPrintTestsDelegate::instance()->SetupConnector( 45 CloudPrintTestsDelegate::instance()->SetupConnector(
46 params->user_email, 46 params->user_email,
47 params->robot_email, 47 params->robot_email,
48 params->credentials, 48 params->credentials,
49 params->connect_new_printers, 49 params->user_settings);
50 params->printer_blacklist);
51 } else { 50 } else {
52 if (!CloudPrintProxyServiceFactory::GetForProfile(profile_)) 51 if (!CloudPrintProxyServiceFactory::GetForProfile(profile_))
53 return false; 52 return false;
53 scoped_ptr<base::DictionaryValue> user_setings(
54 params->user_settings.ToValue());
54 CloudPrintProxyServiceFactory::GetForProfile(profile_)-> 55 CloudPrintProxyServiceFactory::GetForProfile(profile_)->
55 EnableForUserWithRobot(params->credentials, 56 EnableForUserWithRobot(params->credentials,
56 params->robot_email, 57 params->robot_email,
57 params->user_email, 58 params->user_email,
58 params->connect_new_printers, 59 *user_setings);
59 params->printer_blacklist);
60 } 60 }
61 SendResponse(true); 61 SendResponse(true);
62 return true; 62 return true;
63 } 63 }
64 64
65 CloudPrintPrivateGetHostNameFunction::CloudPrintPrivateGetHostNameFunction() { 65 CloudPrintPrivateGetHostNameFunction::CloudPrintPrivateGetHostNameFunction() {
66 } 66 }
67 67
68 CloudPrintPrivateGetHostNameFunction::~CloudPrintPrivateGetHostNameFunction() { 68 CloudPrintPrivateGetHostNameFunction::~CloudPrintPrivateGetHostNameFunction() {
69 } 69 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 bool CloudPrintPrivateGetClientIdFunction::RunImpl() { 113 bool CloudPrintPrivateGetClientIdFunction::RunImpl() {
114 SetResult(Value::CreateStringValue( 114 SetResult(Value::CreateStringValue(
115 CloudPrintTestsDelegate::instance() ? 115 CloudPrintTestsDelegate::instance() ?
116 CloudPrintTestsDelegate::instance()->GetClientId() : 116 CloudPrintTestsDelegate::instance()->GetClientId() :
117 google_apis::GetOAuth2ClientID(google_apis::CLIENT_CLOUD_PRINT))); 117 google_apis::GetOAuth2ClientID(google_apis::CLIENT_CLOUD_PRINT)));
118 SendResponse(true); 118 SendResponse(true);
119 return true; 119 return true;
120 } 120 }
121 121
122 } // namespace extensions 122 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698