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

Side by Side Diff: extensions/browser/url_request_util.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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/url_request_util.h" 5 #include "extensions/browser/url_request_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "content/public/browser/resource_request_info.h" 9 #include "content/public/browser/resource_request_info.h"
10 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" 10 #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 // If the request is for navigations outside of webviews, then it should be 41 // If the request is for navigations outside of webviews, then it should be
42 // allowed. The navigation logic in CrossSiteResourceHandler will properly 42 // allowed. The navigation logic in CrossSiteResourceHandler will properly
43 // transfer the navigation to a privileged process before it commits. 43 // transfer the navigation to a privileged process before it commits.
44 if (content::IsResourceTypeFrame(info->GetResourceType()) && !is_guest) { 44 if (content::IsResourceTypeFrame(info->GetResourceType()) && !is_guest) {
45 *allowed = true; 45 *allowed = true;
46 return true; 46 return true;
47 } 47 }
48 48
49 if (!content::PageTransitionIsWebTriggerable(info->GetPageTransition())) { 49 if (!ui::PageTransitionIsWebTriggerable(info->GetPageTransition())) {
50 *allowed = false; 50 *allowed = false;
51 return true; 51 return true;
52 } 52 }
53 53
54 // The following checks require that we have an actual extension object. If we 54 // The following checks require that we have an actual extension object. If we
55 // don't have it, allow the request handling to continue with the rest of the 55 // don't have it, allow the request handling to continue with the rest of the
56 // checks. 56 // checks.
57 if (!extension) { 57 if (!extension) {
58 *allowed = true; 58 *allowed = true;
59 return true; 59 return true;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 const content::ResourceRequestInfo* info = 93 const content::ResourceRequestInfo* info =
94 content::ResourceRequestInfo::ForRequest(request); 94 content::ResourceRequestInfo::ForRequest(request);
95 // |info| can be NULL sometimes: http://crbug.com/370070. 95 // |info| can be NULL sometimes: http://crbug.com/370070.
96 if (!info) 96 if (!info)
97 return false; 97 return false;
98 return WebViewRendererState::GetInstance()->IsGuest(info->GetChildID()); 98 return WebViewRendererState::GetInstance()->IsGuest(info->GetChildID());
99 } 99 }
100 100
101 } // namespace url_request_util 101 } // namespace url_request_util
102 } // namespace extensions 102 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_guest.cc ('k') | extensions/shell/renderer/shell_content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698