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

Side by Side Diff: android_webview/browser/aw_login_delegate.cc

Issue 279633003: Use non-static set_key interface on DataReductionProxySettings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp Created 6 years, 7 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 | « no previous file | android_webview/browser/net/aw_url_request_context_getter.cc » ('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 (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 "android_webview/browser/aw_login_delegate.h" 5 #include "android_webview/browser/aw_login_delegate.h"
6 6
7 #include "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/supports_user_data.h" 10 #include "base/supports_user_data.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 render_frame_host); 98 render_frame_host);
99 AwBrowserContext* browser_context = 99 AwBrowserContext* browser_context =
100 AwBrowserContext::FromWebContents(web_contents); 100 AwBrowserContext::FromWebContents(web_contents);
101 DataReductionProxySettings* drp_settings = 101 DataReductionProxySettings* drp_settings =
102 browser_context->GetDataReductionProxySettings(); 102 browser_context->GetDataReductionProxySettings();
103 if (drp_settings && drp_settings->IsDataReductionProxyEnabled()) { 103 if (drp_settings && drp_settings->IsDataReductionProxyEnabled()) {
104 // The data reduction proxy auth handler should only be reset on the first 104 // The data reduction proxy auth handler should only be reset on the first
105 // auth attempt, because it maintains internal state to cancel if there have 105 // auth attempt, because it maintains internal state to cancel if there have
106 // been too many attempts. 106 // been too many attempts.
107 if (!drp_auth_handler_.get()) { 107 if (!drp_auth_handler_.get()) {
108 drp_auth_handler_.reset(new DataReductionProxyAuthRequestHandler()); 108 drp_auth_handler_.reset(new DataReductionProxyAuthRequestHandler(
109 drp_settings));
109 } 110 }
110 DCHECK(drp_auth_handler_.get()); 111 DCHECK(drp_auth_handler_.get());
111 base::string16 user, password; 112 base::string16 user, password;
112 DataReductionProxyAuthRequestHandler::TryHandleResult drp_result = 113 DataReductionProxyAuthRequestHandler::TryHandleResult drp_result =
113 drp_auth_handler_->TryHandleAuthentication( 114 drp_auth_handler_->TryHandleAuthentication(
114 auth_info_.get(), &user, &password); 115 auth_info_.get(), &user, &password);
115 if (drp_result == 116 if (drp_result ==
116 DataReductionProxyAuthRequestHandler::TRY_HANDLE_RESULT_PROCEED) { 117 DataReductionProxyAuthRequestHandler::TRY_HANDLE_RESULT_PROCEED) {
117 Proceed(user, password); 118 Proceed(user, password);
118 return; 119 return;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 void AwLoginDelegate::DeleteAuthHandlerSoon() { 162 void AwLoginDelegate::DeleteAuthHandlerSoon() {
162 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { 163 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
163 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 164 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
164 base::Bind(&AwLoginDelegate::DeleteAuthHandlerSoon, this)); 165 base::Bind(&AwLoginDelegate::DeleteAuthHandlerSoon, this));
165 return; 166 return;
166 } 167 }
167 aw_http_auth_handler_.reset(); 168 aw_http_auth_handler_.reset();
168 } 169 }
169 170
170 } // namespace android_webview 171 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/net/aw_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698