Upstream SIGNOUT_ALLOWED pref for AccountManagementFragment.
[chromium-blink-merge.git] / google_apis / drive / request_util.cc
blob1e552857d4e1efbc656f1892d3ff5e9808d85327
1 // Copyright (c) 2013 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 "google_apis/drive/request_util.h"
7 #include <string>
8 #include "base/values.h"
10 namespace google_apis {
11 namespace util {
13 namespace {
15 // etag matching header.
16 const char kIfMatchHeaderPrefix[] = "If-Match: ";
17 const char kParentLinkKind[] = "drive#fileLink";
19 } // namespace
21 const char kIfMatchAllHeader[] = "If-Match: *";
22 const char kContentTypeApplicationJson[] = "application/json";
24 std::string GenerateIfMatchHeader(const std::string& etag) {
25 return etag.empty() ? kIfMatchAllHeader : (kIfMatchHeaderPrefix + etag);
28 scoped_ptr<base::DictionaryValue> CreateParentValue(
29 const std::string& file_id) {
30 scoped_ptr<base::DictionaryValue> parent(new base::DictionaryValue);
31 parent->SetString("kind", kParentLinkKind);
32 parent->SetString("id", file_id);
33 return parent.Pass();
36 } // namespace util
37 } // namespace google_apis