| 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/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" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 14 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 14 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 15 #include "chrome/browser/ui/webui/constrained_html_ui.h" | 15 #include "chrome/browser/ui/webui/constrained_html_ui.h" |
| 16 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 16 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
| 17 #include "chrome/common/jstemplate_builder.h" | 17 #include "chrome/common/jstemplate_builder.h" |
| 18 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
| 19 #include "content/browser/tab_contents/tab_contents.h" | 19 #include "content/browser/tab_contents/tab_contents.h" |
| 20 #include "grit/browser_resources.h" | 20 #include "grit/browser_resources.h" |
| 21 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
| 24 #include "ui/gfx/size.h" | 24 #include "ui/gfx/size.h" |
| 25 | 25 |
| 26 #if defined(USE_AURA) && !defined(OS_CHROMEOS) |
| 27 // TODO(saintlou): This is another big fat hack like in the FileSelector. |
| 28 namespace chrome { |
| 29 const char kChromeUIHttpAuthHost[] = "http-auth"; |
| 30 const char kChromeUIHttpAuthURL[] = "chrome://http-auth/"; |
| 31 } // namespace chrome |
| 32 #endif |
| 33 |
| 26 class LoginHandlerSource : public ChromeURLDataManager::DataSource { | 34 class LoginHandlerSource : public ChromeURLDataManager::DataSource { |
| 27 public: | 35 public: |
| 28 LoginHandlerSource() | 36 LoginHandlerSource() |
| 29 : DataSource(chrome::kChromeUIHttpAuthHost, MessageLoop::current()) {} | 37 : DataSource(chrome::kChromeUIHttpAuthHost, MessageLoop::current()) {} |
| 30 | 38 |
| 31 virtual void StartDataRequest(const std::string& path, | 39 virtual void StartDataRequest(const std::string& path, |
| 32 bool is_off_the_record, | 40 bool is_off_the_record, |
| 33 int request_id) OVERRIDE { | 41 int request_id) OVERRIDE { |
| 34 DictionaryValue dict; | 42 DictionaryValue dict; |
| 35 dict.SetString("username", | 43 dict.SetString("username", |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 SetDialog(dialog); | 257 SetDialog(dialog); |
| 250 | 258 |
| 251 NotifyAuthNeeded(); | 259 NotifyAuthNeeded(); |
| 252 } | 260 } |
| 253 | 261 |
| 254 // static | 262 // static |
| 255 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, | 263 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, |
| 256 net::URLRequest* request) { | 264 net::URLRequest* request) { |
| 257 return new LoginHandlerHtml(auth_info, request); | 265 return new LoginHandlerHtml(auth_info, request); |
| 258 } | 266 } |
| OLD | NEW |