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" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "net/base/auth.h" | 30 #include "net/base/auth.h" |
31 #include "net/base/load_flags.h" | 31 #include "net/base/load_flags.h" |
32 #include "net/base/net_util.h" | 32 #include "net/base/net_util.h" |
33 #include "net/http/http_transaction_factory.h" | 33 #include "net/http/http_transaction_factory.h" |
34 #include "net/url_request/url_request.h" | 34 #include "net/url_request/url_request.h" |
35 #include "net/url_request/url_request_context.h" | 35 #include "net/url_request/url_request_context.h" |
36 #include "ui/base/l10n/l10n_util.h" | 36 #include "ui/base/l10n/l10n_util.h" |
37 #include "ui/gfx/text_elider.h" | 37 #include "ui/gfx/text_elider.h" |
38 | 38 |
39 #if defined(ENABLE_EXTENSIONS) | 39 #if defined(ENABLE_EXTENSIONS) |
40 #include "extensions/browser/guest_view/guest_view_base.h" | 40 #include "components/guest_view/browser/guest_view_base.h" |
41 #endif | 41 #endif |
42 | 42 |
43 using autofill::PasswordForm; | 43 using autofill::PasswordForm; |
44 using content::BrowserThread; | 44 using content::BrowserThread; |
45 using content::NavigationController; | 45 using content::NavigationController; |
46 using content::RenderViewHost; | 46 using content::RenderViewHost; |
47 using content::RenderViewHostDelegate; | 47 using content::RenderViewHostDelegate; |
48 using content::ResourceDispatcherHost; | 48 using content::ResourceDispatcherHost; |
49 using content::ResourceRequestInfo; | 49 using content::ResourceRequestInfo; |
50 using content::WebContents; | 50 using content::WebContents; |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 l10n_util::GetStringFUTF16(IDS_LOGIN_DIALOG_DESCRIPTION_NO_REALM, | 487 l10n_util::GetStringFUTF16(IDS_LOGIN_DIALOG_DESCRIPTION_NO_REALM, |
488 host_and_port) : | 488 host_and_port) : |
489 l10n_util::GetStringFUTF16(IDS_LOGIN_DIALOG_DESCRIPTION, | 489 l10n_util::GetStringFUTF16(IDS_LOGIN_DIALOG_DESCRIPTION, |
490 host_and_port, | 490 host_and_port, |
491 elided_realm); | 491 elided_realm); |
492 | 492 |
493 if (!driver) { | 493 if (!driver) { |
494 #if defined(ENABLE_EXTENSIONS) | 494 #if defined(ENABLE_EXTENSIONS) |
495 // A WebContents in a <webview> (a GuestView type) does not have a password | 495 // A WebContents in a <webview> (a GuestView type) does not have a password |
496 // manager, but still needs to be able to show login prompts. | 496 // manager, but still needs to be able to show login prompts. |
497 if (extensions::GuestViewBase::FromWebContents(parent_contents)) { | 497 if (guestview::GuestViewBase::FromWebContents(parent_contents)) { |
498 handler->BuildViewForPasswordManager(nullptr, explanation); | 498 handler->BuildViewForPasswordManager(nullptr, explanation); |
499 return; | 499 return; |
500 } | 500 } |
501 #endif | 501 #endif |
502 handler->CancelAuth(); | 502 handler->CancelAuth(); |
503 return; | 503 return; |
504 } | 504 } |
505 | 505 |
506 password_manager::PasswordManager* password_manager = | 506 password_manager::PasswordManager* password_manager = |
507 driver->GetPasswordManager(); | 507 driver->GetPasswordManager(); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 net::URLRequest* request) { | 586 net::URLRequest* request) { |
587 bool is_main_frame = (request->load_flags() & net::LOAD_MAIN_FRAME) != 0; | 587 bool is_main_frame = (request->load_flags() & net::LOAD_MAIN_FRAME) != 0; |
588 LoginHandler* handler = LoginHandler::Create(auth_info, request); | 588 LoginHandler* handler = LoginHandler::Create(auth_info, request); |
589 BrowserThread::PostTask( | 589 BrowserThread::PostTask( |
590 BrowserThread::UI, FROM_HERE, | 590 BrowserThread::UI, FROM_HERE, |
591 base::Bind(&LoginDialogCallback, request->url(), | 591 base::Bind(&LoginDialogCallback, request->url(), |
592 make_scoped_refptr(auth_info), make_scoped_refptr(handler), | 592 make_scoped_refptr(auth_info), make_scoped_refptr(handler), |
593 is_main_frame)); | 593 is_main_frame)); |
594 return handler; | 594 return handler; |
595 } | 595 } |
OLD | NEW |