| 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" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 16 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 17 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 17 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 18 #include "chrome/browser/ui/webui/constrained_html_ui.h" | 18 #include "chrome/browser/ui/webui/constrained_html_ui.h" |
| 19 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 19 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
| 20 #include "chrome/common/jstemplate_builder.h" | 20 #include "chrome/common/jstemplate_builder.h" |
| 21 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
| 22 #include "content/browser/tab_contents/tab_contents.h" | 22 #include "content/browser/tab_contents/tab_contents.h" |
| 23 #include "content/public/browser/web_ui_message_handler.h" |
| 23 #include "grit/browser_resources.h" | 24 #include "grit/browser_resources.h" |
| 24 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 26 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| 27 #include "ui/gfx/size.h" | 28 #include "ui/gfx/size.h" |
| 28 | 29 |
| 29 using content::BrowserThread; | 30 using content::BrowserThread; |
| 30 using content::WebContents; | 31 using content::WebContents; |
| 32 using content::WebUIMessageHandler; |
| 31 | 33 |
| 32 class LoginHandlerSource : public ChromeURLDataManager::DataSource { | 34 class LoginHandlerSource : public ChromeURLDataManager::DataSource { |
| 33 public: | 35 public: |
| 34 LoginHandlerSource() | 36 LoginHandlerSource() |
| 35 : DataSource(chrome::kChromeUIHttpAuthHost, MessageLoop::current()) {} | 37 : DataSource(chrome::kChromeUIHttpAuthHost, MessageLoop::current()) {} |
| 36 | 38 |
| 37 virtual void StartDataRequest(const std::string& path, | 39 virtual void StartDataRequest(const std::string& path, |
| 38 bool is_off_the_record, | 40 bool is_off_the_record, |
| 39 int request_id) OVERRIDE { | 41 int request_id) OVERRIDE { |
| 40 DictionaryValue dict; | 42 DictionaryValue dict; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 SetDialog(dialog); | 259 SetDialog(dialog); |
| 258 | 260 |
| 259 NotifyAuthNeeded(); | 261 NotifyAuthNeeded(); |
| 260 } | 262 } |
| 261 | 263 |
| 262 // static | 264 // static |
| 263 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, | 265 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, |
| 264 net::URLRequest* request) { | 266 net::URLRequest* request) { |
| 265 return new LoginHandlerHtml(auth_info, request); | 267 return new LoginHandlerHtml(auth_info, request); |
| 266 } | 268 } |
| OLD | NEW |