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