Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: content/shell/browser/shell_login_dialog.cc

Issue 2067933002: Use correct origin when prompting for proxy authentication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix content_shell build. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/login/login_handler_unittest.cc ('k') | net/base/auth.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/shell/browser/shell_login_dialog.h" 5 #include "content/shell/browser/shell_login_dialog.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 #include "components/url_formatter/elide_url.h"
11 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
12 #include "content/public/browser/resource_dispatcher_host.h" 13 #include "content/public/browser/resource_dispatcher_host.h"
13 #include "net/base/auth.h" 14 #include "net/base/auth.h"
14 #include "net/url_request/url_request.h" 15 #include "net/url_request/url_request.h"
15 #include "ui/gfx/text_elider.h" 16 #include "ui/gfx/text_elider.h"
16 17
17 namespace content { 18 namespace content {
18 19
19 ShellLoginDialog::ShellLoginDialog( 20 ShellLoginDialog::ShellLoginDialog(
20 net::AuthChallengeInfo* auth_info, 21 net::AuthChallengeInfo* auth_info,
21 net::URLRequest* request) : auth_info_(auth_info), 22 net::URLRequest* request) : auth_info_(auth_info),
22 request_(request) { 23 request_(request) {
23 DCHECK_CURRENTLY_ON(BrowserThread::IO); 24 DCHECK_CURRENTLY_ON(BrowserThread::IO);
24 BrowserThread::PostTask( 25 BrowserThread::PostTask(
25 BrowserThread::UI, FROM_HERE, 26 BrowserThread::UI, FROM_HERE,
26 base::Bind(&ShellLoginDialog::PrepDialog, this, 27 base::Bind(
27 base::ASCIIToUTF16(auth_info->challenger.ToString()), 28 &ShellLoginDialog::PrepDialog, this,
28 base::UTF8ToUTF16(auth_info->realm))); 29 url_formatter::FormatOriginForSecurityDisplay(auth_info->challenger),
30 base::UTF8ToUTF16(auth_info->realm)));
29 } 31 }
30 32
31 void ShellLoginDialog::OnRequestCancelled() { 33 void ShellLoginDialog::OnRequestCancelled() {
32 DCHECK_CURRENTLY_ON(BrowserThread::IO); 34 DCHECK_CURRENTLY_ON(BrowserThread::IO);
33 BrowserThread::PostTask( 35 BrowserThread::PostTask(
34 BrowserThread::UI, FROM_HERE, 36 BrowserThread::UI, FROM_HERE,
35 base::Bind(&ShellLoginDialog::PlatformRequestCancelled, this)); 37 base::Bind(&ShellLoginDialog::PlatformRequestCancelled, this));
36 } 38 }
37 39
38 void ShellLoginDialog::UserAcceptedAuth(const base::string16& username, 40 void ShellLoginDialog::UserAcceptedAuth(const base::string16& username,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 else 101 else
100 request_->CancelAuth(); 102 request_->CancelAuth();
101 ResourceDispatcherHost::Get()->ClearLoginDelegateForRequest(request_); 103 ResourceDispatcherHost::Get()->ClearLoginDelegateForRequest(request_);
102 104
103 BrowserThread::PostTask( 105 BrowserThread::PostTask(
104 BrowserThread::UI, FROM_HERE, 106 BrowserThread::UI, FROM_HERE,
105 base::Bind(&ShellLoginDialog::PlatformCleanUp, this)); 107 base::Bind(&ShellLoginDialog::PlatformCleanUp, this));
106 } 108 }
107 109
108 } // namespace content 110 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/ui/login/login_handler_unittest.cc ('k') | net/base/auth.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698