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

Side by Side Diff: chrome/common/about_handler.cc

Issue 7068007: Revise about: and chrome: url handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update special_tabs.py from Nirnimesh's codereview.chromium.org/6995057/. Created 9 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/common/about_handler.h ('k') | chrome/common/url_constants.h » ('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) 2011 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/common/about_handler.h" 5 #include "chrome/common/about_handler.h"
6 #include "chrome/common/url_constants.h" 6 #include "chrome/common/url_constants.h"
7 #include "googleurl/src/gurl.h" 7 #include "googleurl/src/gurl.h"
8 8
9 namespace chrome_about_handler { 9 namespace chrome_about_handler {
10 10
11 // This needs to match up with about_urls_handlers in 11 // This needs to match up with about_urls_handlers in
12 // chrome/renderer/about_handler.cc. 12 // chrome/renderer/about_handler.cc.
13 const char* const about_urls[] = { 13 const char* const about_urls[] = {
14 chrome::kAboutCrashURL, 14 chrome::kChromeUICrashURL,
15 chrome::kAboutKillURL, 15 chrome::kChromeUIKillURL,
16 chrome::kAboutHangURL, 16 chrome::kChromeUIHangURL,
17 chrome::kAboutShorthangURL, 17 chrome::kChromeUIShorthangURL,
18 NULL, 18 NULL,
19 }; 19 };
20 const size_t about_urls_size = arraysize(about_urls); 20 const size_t about_urls_size = arraysize(about_urls);
21 21
22 const char* const kAboutScheme = "about";
23
24 bool WillHandle(const GURL& url) { 22 bool WillHandle(const GURL& url) {
25 if (url.scheme() != kAboutScheme) 23 if (!url.SchemeIs(chrome::kChromeUIScheme))
26 return false; 24 return false;
27 25
28 const char* const* url_handler = about_urls; 26 const char* const* url_handler = about_urls;
29 while (*url_handler) { 27 while (*url_handler) {
30 if (GURL(*url_handler) == url) 28 if (GURL(*url_handler) == url)
31 return true; 29 return true;
32 url_handler++; 30 url_handler++;
33 } 31 }
34 return false; 32 return false;
35 } 33 }
36 34
37 } // namespace chrome_about_handler 35 } // namespace chrome_about_handler
OLDNEW
« no previous file with comments | « chrome/common/about_handler.h ('k') | chrome/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698