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: content/browser/webui/url_data_manager_backend.cc

Issue 168953002: Cleanup: Move kChromeDevToolsScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « content/browser/storage_partition_impl_map.cc ('k') | content/common/savable_url_schemes.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 "content/browser/webui/url_data_manager_backend.h" 5 #include "content/browser/webui/url_data_manager_backend.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 const char kChromeURLXFrameOptionsHeader[] = "X-Frame-Options: DENY"; 57 const char kChromeURLXFrameOptionsHeader[] = "X-Frame-Options: DENY";
58 58
59 bool SchemeIsInSchemes(const std::string& scheme, 59 bool SchemeIsInSchemes(const std::string& scheme,
60 const std::vector<std::string>& schemes) { 60 const std::vector<std::string>& schemes) {
61 return std::find(schemes.begin(), schemes.end(), scheme) != schemes.end(); 61 return std::find(schemes.begin(), schemes.end(), scheme) != schemes.end();
62 } 62 }
63 63
64 // Returns whether |url| passes some sanity checks and is a valid GURL. 64 // Returns whether |url| passes some sanity checks and is a valid GURL.
65 bool CheckURLIsValid(const GURL& url) { 65 bool CheckURLIsValid(const GURL& url) {
66 std::vector<std::string> additional_schemes; 66 std::vector<std::string> additional_schemes;
67 DCHECK(url.SchemeIs(chrome::kChromeDevToolsScheme) || 67 DCHECK(url.SchemeIs(kChromeDevToolsScheme) || url.SchemeIs(kChromeUIScheme) ||
68 url.SchemeIs(kChromeUIScheme) ||
69 (GetContentClient()->browser()->GetAdditionalWebUISchemes( 68 (GetContentClient()->browser()->GetAdditionalWebUISchemes(
70 &additional_schemes), 69 &additional_schemes),
71 SchemeIsInSchemes(url.scheme(), additional_schemes))); 70 SchemeIsInSchemes(url.scheme(), additional_schemes)));
72 71
73 if (!url.is_valid()) { 72 if (!url.is_valid()) {
74 NOTREACHED(); 73 NOTREACHED();
75 return false; 74 return false;
76 } 75 }
77 76
78 return true; 77 return true;
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 714
716 } // namespace 715 } // namespace
717 716
718 net::URLRequestJobFactory::ProtocolHandler* 717 net::URLRequestJobFactory::ProtocolHandler*
719 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context, 718 CreateDevToolsProtocolHandler(content::ResourceContext* resource_context,
720 bool is_incognito) { 719 bool is_incognito) {
721 return new DevToolsJobFactory(resource_context, is_incognito); 720 return new DevToolsJobFactory(resource_context, is_incognito);
722 } 721 }
723 722
724 } // namespace content 723 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl_map.cc ('k') | content/common/savable_url_schemes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698