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

Unified Diff: chrome/common/about_handler.cc

Issue 2814012: Split part of about_handler into chrome/common to break the browser-renderer ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: with unit test Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/about_handler.h ('k') | chrome/renderer/about_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/about_handler.cc
===================================================================
--- chrome/common/about_handler.cc (revision 0)
+++ chrome/common/about_handler.cc (revision 0)
@@ -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
Property changes on: chrome/common/about_handler.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/common/about_handler.h ('k') | chrome/renderer/about_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698