summaryrefslogtreecommitdiffstats
path: root/chrome/common/about_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common/about_handler.cc')
-rw-r--r--chrome/common/about_handler.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/chrome/common/about_handler.cc b/chrome/common/about_handler.cc
new file mode 100644
index 0000000..84658a0
--- /dev/null
+++ b/chrome/common/about_handler.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/about_handler.h"
+
+namespace chrome_about_handler {
+
+// This needs to match up with about_urls_handlers in
+// chrome/renderer/about_handler.cc.
+const char* const about_urls[] = {
+ chrome::kAboutCrashURL,
+ chrome::kAboutHangURL,
+ chrome::kAboutShorthangURL,
+ NULL,
+};
+const size_t about_urls_size = arraysize(about_urls);
+
+const char* const kAboutScheme = "about";
+
+bool WillHandle(const GURL& url) {
+ if (url.scheme() != kAboutScheme)
+ return false;
+
+ const char* const* url_handler = about_urls;
+ while (*url_handler) {
+ if (GURL(*url_handler) == url)
+ return true;
+ url_handler++;
+ }
+ return false;
+}
+
+} // namespace chrome_about_handler