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

Unified Diff: chrome/common/net/gaia/oauth2_access_token_fetcher.cc

Issue 10012051: Add a mode to OAuth2MintTokenFlow that fetches the messages to show to the user. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/net/gaia/oauth2_access_token_fetcher.cc
===================================================================
--- chrome/common/net/gaia/oauth2_access_token_fetcher.cc (revision 130985)
+++ chrome/common/net/gaia/oauth2_access_token_fetcher.cc (working copy)
@@ -42,20 +42,6 @@
static const char kAccessTokenKey[] = "access_token";
-static bool GetStringFromDictionary(const DictionaryValue* dict,
- const std::string& key,
- std::string* value) {
- Value* json_value;
- if (!dict->Get(key, &json_value))
- return false;
- if (json_value->GetType() != base::Value::TYPE_STRING)
- return false;
-
- StringValue* json_str_value = static_cast<StringValue*>(json_value);
- json_str_value->GetAsString(value);
- return true;
-}
-
static GoogleServiceAuthError CreateAuthError(URLRequestStatus status) {
CHECK(!status.is_success());
if (status.status() == URLRequestStatus::CANCELED) {
@@ -211,5 +197,5 @@
return false;
DictionaryValue* dict = static_cast<DictionaryValue*>(value.get());
- return GetStringFromDictionary(dict, kAccessTokenKey, access_token);
+ return dict->GetString(kAccessTokenKey, access_token);
}

Powered by Google App Engine
This is Rietveld 408576698