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

Side by Side Diff: chrome/browser/ui/login/login_prompt_ui.cc

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/login/login_prompt.h" 5 #include "chrome/browser/ui/login/login_prompt.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 DISALLOW_COPY_AND_ASSIGN(LoginHandlerHtml); 190 DISALLOW_COPY_AND_ASSIGN(LoginHandlerHtml);
191 }; 191 };
192 192
193 void LoginHandlerHtmlDelegate::OnDialogClosed(const std::string& json_retval) { 193 void LoginHandlerHtmlDelegate::OnDialogClosed(const std::string& json_retval) {
194 if (closed_) 194 if (closed_)
195 return; 195 return;
196 closed_ = true; 196 closed_ = true;
197 197
198 scoped_ptr<Value> parsed_value(base::JSONReader::Read(json_retval, false)); 198 scoped_ptr<Value> parsed_value(base::JSONReader::Read(json_retval, false));
199 199
200 if (!parsed_value.get() || !parsed_value->IsType(Value::TYPE_DICTIONARY)) { 200 if (!parsed_value.get() || !parsed_value->IsDictionary()) {
201 login_handler_->CancelAuth(); 201 login_handler_->CancelAuth();
202 } else { 202 } else {
203 DictionaryValue* res = static_cast<DictionaryValue*>(parsed_value.get()); 203 DictionaryValue* res = static_cast<DictionaryValue*>(parsed_value.get());
204 string16 username; 204 string16 username;
205 string16 password; 205 string16 password;
206 206
207 if (!res->GetString("username", &username) || 207 if (!res->GetString("username", &username) ||
208 !res->GetString("password", &password)) { 208 !res->GetString("password", &password)) {
209 login_handler_->CancelAuth(); 209 login_handler_->CancelAuth();
210 } else { 210 } else {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 SetDialog(dialog); 250 SetDialog(dialog);
251 251
252 NotifyAuthNeeded(); 252 NotifyAuthNeeded();
253 } 253 }
254 254
255 // static 255 // static
256 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, 256 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info,
257 net::URLRequest* request) { 257 net::URLRequest* request) {
258 return new LoginHandlerHtml(auth_info, request); 258 return new LoginHandlerHtml(auth_info, request);
259 } 259 }
OLDNEW
« no previous file with comments | « chrome/browser/translate/translate_manager.cc ('k') | chrome/browser/ui/views/select_file_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698