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

Side by Side Diff: chrome_frame/navigation_constraints.cc

Issue 15950011: content: Move kViewSourceScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome_frame/chrome_frame_activex_base.h ('k') | chrome_frame/test/ui_test.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_frame/navigation_constraints.h" 5 #include "chrome_frame/navigation_constraints.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "chrome_frame/utils.h" 10 #include "chrome_frame/utils.h"
(...skipping 14 matching lines...) Expand all
25 25
26 if (!url.is_valid()) 26 if (!url.is_valid())
27 return false; 27 return false;
28 28
29 if (url.SchemeIs(chrome::kHttpScheme) || 29 if (url.SchemeIs(chrome::kHttpScheme) ||
30 url.SchemeIs(chrome::kHttpsScheme)) 30 url.SchemeIs(chrome::kHttpsScheme))
31 return true; 31 return true;
32 32
33 // Additional checking for view-source. Allow only http and https 33 // Additional checking for view-source. Allow only http and https
34 // URLs in view source. 34 // URLs in view source.
35 if (url.SchemeIs(chrome::kViewSourceScheme)) { 35 if (url.SchemeIs(content::kViewSourceScheme)) {
36 GURL sub_url(url.path()); 36 GURL sub_url(url.path());
37 if (sub_url.SchemeIs(chrome::kHttpScheme) || 37 if (sub_url.SchemeIs(chrome::kHttpScheme) ||
38 sub_url.SchemeIs(chrome::kHttpsScheme)) 38 sub_url.SchemeIs(chrome::kHttpsScheme))
39 return true; 39 return true;
40 } 40 }
41 41
42 // Allow only about:blank or about:version 42 // Allow only about:blank or about:version
43 if (url.SchemeIs(chrome::kAboutScheme)) { 43 if (url.SchemeIs(chrome::kAboutScheme)) {
44 if (LowerCaseEqualsASCII(url.spec(), content::kAboutBlankURL) || 44 if (LowerCaseEqualsASCII(url.spec(), content::kAboutBlankURL) ||
45 LowerCaseEqualsASCII(url.spec(), chrome::kAboutVersionURL)) { 45 LowerCaseEqualsASCII(url.spec(), chrome::kAboutVersionURL)) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return true; 78 return true;
79 } 79 }
80 80
81 bool NavigationConstraintsImpl::is_privileged() const { 81 bool NavigationConstraintsImpl::is_privileged() const {
82 return is_privileged_; 82 return is_privileged_;
83 } 83 }
84 84
85 void NavigationConstraintsImpl::set_is_privileged(bool is_privileged) { 85 void NavigationConstraintsImpl::set_is_privileged(bool is_privileged) {
86 is_privileged_ = is_privileged; 86 is_privileged_ = is_privileged;
87 } 87 }
OLDNEW
« no previous file with comments | « chrome_frame/chrome_frame_activex_base.h ('k') | chrome_frame/test/ui_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698