| OLD | NEW |
| 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/bind.h" |
| 10 #include "base/bind_helpers.h" |
| 9 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 10 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 11 #include "base/values.h" | 13 #include "base/values.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 14 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 16 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 15 #include "chrome/browser/ui/webui/constrained_html_ui.h" | 17 #include "chrome/browser/ui/webui/constrained_html_ui.h" |
| 16 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 18 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
| 17 #include "chrome/common/jstemplate_builder.h" | 19 #include "chrome/common/jstemplate_builder.h" |
| 18 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 bool* out_close_dialog) OVERRIDE {} | 124 bool* out_close_dialog) OVERRIDE {} |
| 123 | 125 |
| 124 virtual bool ShouldShowDialogTitle() const OVERRIDE { | 126 virtual bool ShouldShowDialogTitle() const OVERRIDE { |
| 125 return true; | 127 return true; |
| 126 } | 128 } |
| 127 | 129 |
| 128 // WebUIMessageHandler method: | 130 // WebUIMessageHandler method: |
| 129 virtual void RegisterMessages() OVERRIDE { | 131 virtual void RegisterMessages() OVERRIDE { |
| 130 web_ui_->RegisterMessageCallback( | 132 web_ui_->RegisterMessageCallback( |
| 131 "GetAutofill", | 133 "GetAutofill", |
| 132 NewCallback(this, &LoginHandlerHtmlDelegate::GetAutofill)); | 134 base::Bind(&LoginHandlerHtmlDelegate::GetAutofill, |
| 135 base::Unretained(this))); |
| 133 } | 136 } |
| 134 | 137 |
| 135 void ShowAutofillData(const std::wstring& username, | 138 void ShowAutofillData(const std::wstring& username, |
| 136 const std::wstring& password); | 139 const std::wstring& password); |
| 137 | 140 |
| 138 private: | 141 private: |
| 139 // Send autofill data to HTML once the dialog is ready and the data is | 142 // Send autofill data to HTML once the dialog is ready and the data is |
| 140 // available. | 143 // available. |
| 141 void SendAutofillData(); | 144 void SendAutofillData(); |
| 142 | 145 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 SetDialog(dialog); | 260 SetDialog(dialog); |
| 258 | 261 |
| 259 NotifyAuthNeeded(); | 262 NotifyAuthNeeded(); |
| 260 } | 263 } |
| 261 | 264 |
| 262 // static | 265 // static |
| 263 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, | 266 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, |
| 264 net::URLRequest* request) { | 267 net::URLRequest* request) { |
| 265 return new LoginHandlerHtml(auth_info, request); | 268 return new LoginHandlerHtml(auth_info, request); |
| 266 } | 269 } |
| OLD | NEW |