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

Side by Side Diff: chrome/common/extensions/api/identity/oauth2_manifest_handler.cc

Issue 105473003: Add explicit base namespace to string16 users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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) 2013 The Chromium Authors. All rights reserved. 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 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/common/extensions/api/identity/oauth2_manifest_handler.h" 5 #include "chrome/common/extensions/api/identity/oauth2_manifest_handler.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 27 matching lines...) Expand all
38 return info ? *info : g_empty_oauth2_info.Get(); 38 return info ? *info : g_empty_oauth2_info.Get();
39 } 39 }
40 40
41 OAuth2ManifestHandler::OAuth2ManifestHandler() { 41 OAuth2ManifestHandler::OAuth2ManifestHandler() {
42 } 42 }
43 43
44 OAuth2ManifestHandler::~OAuth2ManifestHandler() { 44 OAuth2ManifestHandler::~OAuth2ManifestHandler() {
45 } 45 }
46 46
47 bool OAuth2ManifestHandler::Parse(Extension* extension, 47 bool OAuth2ManifestHandler::Parse(Extension* extension,
48 string16* error) { 48 base::string16* error) {
49 scoped_ptr<OAuth2Info> info(new OAuth2Info); 49 scoped_ptr<OAuth2Info> info(new OAuth2Info);
50 const base::DictionaryValue* dict = NULL; 50 const base::DictionaryValue* dict = NULL;
51 if (!extension->manifest()->GetDictionary(keys::kOAuth2, &dict)) { 51 if (!extension->manifest()->GetDictionary(keys::kOAuth2, &dict)) {
52 *error = ASCIIToUTF16(errors::kInvalidOAuth2ClientId); 52 *error = ASCIIToUTF16(errors::kInvalidOAuth2ClientId);
53 return false; 53 return false;
54 } 54 }
55 55
56 // HasPath checks for whether the manifest is allowed to have 56 // HasPath checks for whether the manifest is allowed to have
57 // oauth2.auto_approve based on whitelist, and if it is present. 57 // oauth2.auto_approve based on whitelist, and if it is present.
58 // GetBoolean reads the value of auto_approve directly from dict to prevent 58 // GetBoolean reads the value of auto_approve directly from dict to prevent
(...skipping 30 matching lines...) Expand all
89 89
90 extension->SetManifestData(keys::kOAuth2, info.release()); 90 extension->SetManifestData(keys::kOAuth2, info.release());
91 return true; 91 return true;
92 } 92 }
93 93
94 const std::vector<std::string> OAuth2ManifestHandler::Keys() const { 94 const std::vector<std::string> OAuth2ManifestHandler::Keys() const {
95 return SingleKey(keys::kOAuth2); 95 return SingleKey(keys::kOAuth2);
96 } 96 }
97 97
98 } // namespace extensions 98 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698