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

Side by Side Diff: android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc

Issue 562603002: Move PageTransition from //content/public/common to //ui/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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/java/src/org/chromium/android_webview/AwContents.java » ('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/renderer_host/aw_resource_dispatcher_host_dele gate.h" 5 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "android_webview/browser/aw_contents_io_thread_client.h" 9 #include "android_webview/browser/aw_contents_io_thread_client.h"
10 #include "android_webview/browser/aw_login_delegate.h" 10 #include "android_webview/browser/aw_login_delegate.h"
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 void AwResourceDispatcherHostDelegate::AddExtraHeadersIfNeeded( 399 void AwResourceDispatcherHostDelegate::AddExtraHeadersIfNeeded(
400 net::URLRequest* request, 400 net::URLRequest* request,
401 content::ResourceContext* resource_context) { 401 content::ResourceContext* resource_context) {
402 const content::ResourceRequestInfo* request_info = 402 const content::ResourceRequestInfo* request_info =
403 content::ResourceRequestInfo::ForRequest(request); 403 content::ResourceRequestInfo::ForRequest(request);
404 if (!request_info) 404 if (!request_info)
405 return; 405 return;
406 if (request_info->GetResourceType() != content::RESOURCE_TYPE_MAIN_FRAME) 406 if (request_info->GetResourceType() != content::RESOURCE_TYPE_MAIN_FRAME)
407 return; 407 return;
408 408
409 const content::PageTransition transition = request_info->GetPageTransition(); 409 const ui::PageTransition transition = request_info->GetPageTransition();
410 const bool is_load_url = 410 const bool is_load_url =
411 transition & content::PAGE_TRANSITION_FROM_API; 411 transition & ui::PAGE_TRANSITION_FROM_API;
412 const bool is_go_back_forward = 412 const bool is_go_back_forward =
413 transition & content::PAGE_TRANSITION_FORWARD_BACK; 413 transition & ui::PAGE_TRANSITION_FORWARD_BACK;
414 const bool is_reload = content::PageTransitionCoreTypeIs( 414 const bool is_reload = ui::PageTransitionCoreTypeIs(
415 transition, content::PAGE_TRANSITION_RELOAD); 415 transition, ui::PAGE_TRANSITION_RELOAD);
416 if (is_load_url || is_go_back_forward || is_reload) { 416 if (is_load_url || is_go_back_forward || is_reload) {
417 AwResourceContext* awrc = static_cast<AwResourceContext*>(resource_context); 417 AwResourceContext* awrc = static_cast<AwResourceContext*>(resource_context);
418 std::string extra_headers = awrc->GetExtraHeaders(request->url()); 418 std::string extra_headers = awrc->GetExtraHeaders(request->url());
419 if (!extra_headers.empty()) { 419 if (!extra_headers.empty()) {
420 net::HttpRequestHeaders headers; 420 net::HttpRequestHeaders headers;
421 headers.AddHeadersFromString(extra_headers); 421 headers.AddHeadersFromString(extra_headers);
422 for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext(); ) { 422 for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext(); ) {
423 request->SetExtraRequestHeaderByName(it.name(), it.value(), false); 423 request->SetExtraRequestHeaderByName(it.name(), it.value(), false);
424 } 424 }
425 } 425 }
426 } 426 }
427 } 427 }
428 428
429 } // namespace android_webview 429 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContents.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698