• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #include "chrome/common/about_handler.h"
6 #include "chrome/common/url_constants.h"
7 #include "googleurl/src/gurl.h"
8 
9 namespace chrome_about_handler {
10 
11 // This needs to match up with about_urls_handlers in
12 // chrome/renderer/about_handler.cc.
13 const char* const about_urls[] = {
14   chrome::kAboutCrashURL,
15   chrome::kAboutKillURL,
16   chrome::kAboutHangURL,
17   chrome::kAboutShorthangURL,
18   NULL,
19 };
20 const size_t about_urls_size = arraysize(about_urls);
21 
22 const char* const kAboutScheme = "about";
23 
WillHandle(const GURL & url)24 bool WillHandle(const GURL& url) {
25   if (url.scheme() != kAboutScheme)
26     return false;
27 
28   const char* const* url_handler = about_urls;
29   while (*url_handler) {
30     if (GURL(*url_handler) == url)
31       return true;
32     url_handler++;
33   }
34   return false;
35 }
36 
37 }  // namespace chrome_about_handler
38