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

Side by Side Diff: chrome/browser/local_discovery/gcd_registration_ticket_request.cc

Issue 318283002: Added new GCD/Privet interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/local_discovery/gcd_registration_ticket_request.h" 5 #include "chrome/browser/local_discovery/gcd_registration_ticket_request.h"
6 6
7 #include "chrome/browser/local_discovery/gcd_constants.h" 7 #include "chrome/browser/local_discovery/gcd_constants.h"
8 #include "chrome/common/cloud_print/cloud_print_constants.h" 8 #include "chrome/common/cloud_print/cloud_print_constants.h"
9 #include "components/cloud_devices/common/cloud_devices_urls.h" 9 #include "components/cloud_devices/common/cloud_devices_urls.h"
10 10
(...skipping 20 matching lines...) Expand all
31 31
32 // TODO(noamsml): Move this constant to cloud_devices component. 32 // TODO(noamsml): Move this constant to cloud_devices component.
33 *upload_type = cloud_print::kContentTypeJSON; 33 *upload_type = cloud_print::kContentTypeJSON;
34 } 34 }
35 35
36 net::URLFetcher::RequestType GCDRegistrationTicketRequest::GetRequestType() { 36 net::URLFetcher::RequestType GCDRegistrationTicketRequest::GetRequestType() {
37 return net::URLFetcher::POST; 37 return net::URLFetcher::POST;
38 } 38 }
39 39
40 void GCDRegistrationTicketRequest::OnGCDAPIFlowError( 40 void GCDRegistrationTicketRequest::OnGCDAPIFlowError(
41 GCDApiFlow::Status status) { 41 GCDApiFlowInterface::Status status) {
42 callback_.Run(std::string()); 42 callback_.Run(std::string());
43 } 43 }
44 44
45 void GCDRegistrationTicketRequest::OnGCDAPIFlowComplete( 45 void GCDRegistrationTicketRequest::OnGCDAPIFlowComplete(
46 const base::DictionaryValue& value) { 46 const base::DictionaryValue& value) {
47 std::string kind; 47 std::string kind;
48 std::string id; 48 std::string id;
49 value.GetString(kGCDKeyKind, &kind); 49 value.GetString(kGCDKeyKind, &kind);
50 if (kind == kKindRegistrationTicket) 50 if (kind == kKindRegistrationTicket)
51 value.GetString(kGCDKeyId, &id); 51 value.GetString(kGCDKeyId, &id);
52 callback_.Run(id); 52 callback_.Run(id);
53 } 53 }
54 54
55 GURL GCDRegistrationTicketRequest::GetURL() { 55 GURL GCDRegistrationTicketRequest::GetURL() {
56 return cloud_devices::GetCloudDevicesRelativeURL("registrationTickets"); 56 return cloud_devices::GetCloudDevicesRelativeURL("registrationTickets");
57 } 57 }
58 58
59 } // namespace local_discovery 59 } // namespace local_discovery
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698