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

Side by Side Diff: chrome/browser/ui/android/login_prompt_android.cc

Issue 1466473003: Do not show untrustworthy strings in the basic auth dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix XIB. Created 5 years 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
OLDNEW
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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 19 matching lines...) Expand all
30 void OnAutofillDataAvailableInternal( 30 void OnAutofillDataAvailableInternal(
31 const base::string16& username, 31 const base::string16& username,
32 const base::string16& password) override { 32 const base::string16& password) override {
33 DCHECK_CURRENTLY_ON(BrowserThread::UI); 33 DCHECK_CURRENTLY_ON(BrowserThread::UI);
34 DCHECK(chrome_http_auth_handler_.get() != NULL); 34 DCHECK(chrome_http_auth_handler_.get() != NULL);
35 chrome_http_auth_handler_->OnAutofillDataAvailable( 35 chrome_http_auth_handler_->OnAutofillDataAvailable(
36 username, password); 36 username, password);
37 } 37 }
38 void OnLoginModelDestroying() override {} 38 void OnLoginModelDestroying() override {}
39 39
40 void BuildViewImpl(const base::string16& explanation, 40 void BuildViewImpl(const base::string16& authority,
41 const base::string16& explanation,
41 LoginModelData* login_model_data) override { 42 LoginModelData* login_model_data) override {
42 DCHECK_CURRENTLY_ON(BrowserThread::UI); 43 DCHECK_CURRENTLY_ON(BrowserThread::UI);
43 44
44 // Get pointer to TabAndroid 45 // Get pointer to TabAndroid
45 content::WebContents* web_contents = GetWebContentsForLogin(); 46 content::WebContents* web_contents = GetWebContentsForLogin();
46 CHECK(web_contents); 47 CHECK(web_contents);
47 WindowAndroidHelper* window_helper = WindowAndroidHelper::FromWebContents( 48 WindowAndroidHelper* window_helper = WindowAndroidHelper::FromWebContents(
48 web_contents); 49 web_contents);
49 50
50 // Notify WindowAndroid that HTTP authentication is required. 51 // Notify WindowAndroid that HTTP authentication is required.
51 if (window_helper->GetWindowAndroid()) { 52 if (window_helper->GetWindowAndroid()) {
52 chrome_http_auth_handler_.reset(new ChromeHttpAuthHandler(explanation)); 53 chrome_http_auth_handler_.reset(
54 new ChromeHttpAuthHandler(authority, explanation));
53 chrome_http_auth_handler_->Init(); 55 chrome_http_auth_handler_->Init();
54 chrome_http_auth_handler_->SetObserver(this); 56 chrome_http_auth_handler_->SetObserver(this);
55 chrome_http_auth_handler_->ShowDialog( 57 chrome_http_auth_handler_->ShowDialog(
56 window_helper->GetWindowAndroid()->GetJavaObject().obj()); 58 window_helper->GetWindowAndroid()->GetJavaObject().obj());
57 59
58 if (login_model_data) 60 if (login_model_data)
59 SetModel(*login_model_data); 61 SetModel(*login_model_data);
60 else 62 else
61 ResetModel(); 63 ResetModel();
62 64
(...skipping 12 matching lines...) Expand all
75 77
76 private: 78 private:
77 scoped_ptr<ChromeHttpAuthHandler> chrome_http_auth_handler_; 79 scoped_ptr<ChromeHttpAuthHandler> chrome_http_auth_handler_;
78 }; 80 };
79 81
80 // static 82 // static
81 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, 83 LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info,
82 net::URLRequest* request) { 84 net::URLRequest* request) {
83 return new LoginHandlerAndroid(auth_info, request); 85 return new LoginHandlerAndroid(auth_info, request);
84 } 86 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/chrome_http_auth_handler.cc ('k') | chrome/browser/ui/cocoa/login_prompt_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698