Refactor SharedMemory::Create and fix a rare file leak.
[chromium-blink-merge.git] / chrome / browser / local_discovery / gcd_api_flow.cc
blobce1d0c93e5e46a1d8affc960a831ee756a31abaf
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
3 // found in the LICENSE file.
5 #include "chrome/browser/local_discovery/gcd_api_flow.h"
7 #include "chrome/browser/local_discovery/gcd_api_flow_impl.h"
8 #include "chrome/browser/local_discovery/gcd_constants.h"
9 #include "chrome/common/cloud_print/cloud_print_constants.h"
10 #include "components/cloud_devices/common/cloud_devices_urls.h"
12 namespace local_discovery {
14 GCDApiFlow::Request::Request() {
17 GCDApiFlow::Request::~Request() {
20 net::URLFetcher::RequestType GCDApiFlow::Request::GetRequestType() {
21 return net::URLFetcher::GET;
24 void GCDApiFlow::Request::GetUploadData(std::string* upload_type,
25 std::string* upload_data) {
26 *upload_type = std::string();
27 *upload_data = std::string();
30 scoped_ptr<GCDApiFlow> GCDApiFlow::Create(
31 net::URLRequestContextGetter* request_context,
32 OAuth2TokenService* token_service,
33 const std::string& account_id) {
34 return scoped_ptr<GCDApiFlow>(
35 new GCDApiFlowImpl(request_context, token_service, account_id));
38 GCDApiFlow::GCDApiFlow() {
41 GCDApiFlow::~GCDApiFlow() {
44 GCDApiFlowRequest::GCDApiFlowRequest() {
47 GCDApiFlowRequest::~GCDApiFlowRequest() {
50 std::string GCDApiFlowRequest::GetOAuthScope() {
51 return cloud_devices::kCloudDevicesAuthScope;
54 std::vector<std::string> GCDApiFlowRequest::GetExtraRequestHeaders() {
55 return std::vector<std::string>();
58 CloudPrintApiFlowRequest::CloudPrintApiFlowRequest() {
61 CloudPrintApiFlowRequest::~CloudPrintApiFlowRequest() {
64 std::string CloudPrintApiFlowRequest::GetOAuthScope() {
65 return cloud_devices::kCloudPrintAuthScope;
68 std::vector<std::string> CloudPrintApiFlowRequest::GetExtraRequestHeaders() {
69 return std::vector<std::string>(1, cloud_print::kChromeCloudPrintProxyHeader);
72 } // namespace local_discovery