OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
14 #include "chrome/browser/password_manager/password_manager.h" | 14 #include "chrome/browser/password_manager/password_manager.h" |
| 15 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" |
15 #include "chrome/browser/prerender/prerender_contents.h" | 16 #include "chrome/browser/prerender/prerender_contents.h" |
16 #include "chrome/browser/tab_contents/tab_util.h" | 17 #include "chrome/browser/tab_contents/tab_util.h" |
17 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
19 #include "content/public/browser/notification_service.h" | 20 #include "content/public/browser/notification_service.h" |
20 #include "content/public/browser/render_frame_host.h" | 21 #include "content/public/browser/render_frame_host.h" |
21 #include "content/public/browser/resource_dispatcher_host.h" | 22 #include "content/public/browser/resource_dispatcher_host.h" |
22 #include "content/public/browser/resource_request_info.h" | 23 #include "content/public/browser/resource_request_info.h" |
23 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
24 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 } | 428 } |
428 | 429 |
429 prerender::PrerenderContents* prerender_contents = | 430 prerender::PrerenderContents* prerender_contents = |
430 prerender::PrerenderContents::FromWebContents(parent_contents); | 431 prerender::PrerenderContents::FromWebContents(parent_contents); |
431 if (prerender_contents) { | 432 if (prerender_contents) { |
432 prerender_contents->Destroy(prerender::FINAL_STATUS_AUTH_NEEDED); | 433 prerender_contents->Destroy(prerender::FINAL_STATUS_AUTH_NEEDED); |
433 return; | 434 return; |
434 } | 435 } |
435 | 436 |
436 PasswordManager* password_manager = | 437 PasswordManager* password_manager = |
437 PasswordManager::FromWebContents(parent_contents); | 438 PasswordManagerDelegateImpl::GetManagerFromWebContents(parent_contents); |
438 if (!password_manager) { | 439 if (!password_manager) { |
439 // Same logic as above. | 440 // Same logic as above. |
440 handler->CancelAuth(); | 441 handler->CancelAuth(); |
441 return; | 442 return; |
442 } | 443 } |
443 | 444 |
444 // Tell the password manager to look for saved passwords. | 445 // Tell the password manager to look for saved passwords. |
445 std::vector<PasswordForm> v; | 446 std::vector<PasswordForm> v; |
446 MakeInputForPasswordManager(request_url, auth_info, handler, &v); | 447 MakeInputForPasswordManager(request_url, auth_info, handler, &v); |
447 password_manager->OnPasswordFormsParsed(v); | 448 password_manager->OnPasswordFormsParsed(v); |
(...skipping 20 matching lines...) Expand all Loading... |
468 | 469 |
469 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, | 470 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, |
470 net::URLRequest* request) { | 471 net::URLRequest* request) { |
471 LoginHandler* handler = LoginHandler::Create(auth_info, request); | 472 LoginHandler* handler = LoginHandler::Create(auth_info, request); |
472 BrowserThread::PostTask( | 473 BrowserThread::PostTask( |
473 BrowserThread::UI, FROM_HERE, | 474 BrowserThread::UI, FROM_HERE, |
474 base::Bind(&LoginDialogCallback, request->url(), | 475 base::Bind(&LoginDialogCallback, request->url(), |
475 make_scoped_refptr(auth_info), make_scoped_refptr(handler))); | 476 make_scoped_refptr(auth_info), make_scoped_refptr(handler))); |
476 return handler; | 477 return handler; |
477 } | 478 } |
OLD | NEW |