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

Side by Side Diff: chrome/browser/browser_url_handler.cc

Issue 28104: Enable history and downloads by default, port NewTabUI from DOMUIHost to DOMU... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « chrome/browser/browser.cc ('k') | chrome/browser/debugger/debugger_contents.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/browser/browser_url_handler.h" 5 #include "chrome/browser/browser_url_handler.h"
6 6
7 #include "chrome/browser/browser_about_handler.h" 7 #include "chrome/browser/browser_about_handler.h"
8 #include "chrome/browser/dom_ui/new_tab_ui.h"
9 #include "chrome/browser/dom_ui/dom_ui_contents.h" 8 #include "chrome/browser/dom_ui/dom_ui_contents.h"
10 9
11 std::vector<BrowserURLHandler::URLHandler> BrowserURLHandler::url_handlers_; 10 std::vector<BrowserURLHandler::URLHandler> BrowserURLHandler::url_handlers_;
12 11
13 // static 12 // static
14 void BrowserURLHandler::InitURLHandlers() { 13 void BrowserURLHandler::InitURLHandlers() {
15 if (!url_handlers_.empty()) 14 if (!url_handlers_.empty())
16 return; 15 return;
17 16
18 // Here is where we initialize the global list of handlers for special URLs. 17 // Here is where we initialize the global list of handlers for special URLs.
19 // about:* 18 // about:*
20 url_handlers_.push_back(&BrowserAboutHandler::MaybeHandle); 19 url_handlers_.push_back(&BrowserAboutHandler::MaybeHandle);
21 // chrome-internal:*
22 url_handlers_.push_back(&NewTabUIHandleURL);
23 // chrome-ui:* 20 // chrome-ui:*
24 url_handlers_.push_back(&DOMUIContentsCanHandleURL); 21 url_handlers_.push_back(&DOMUIContentsCanHandleURL);
25 } 22 }
26 23
27 // static 24 // static
28 bool BrowserURLHandler::HandleBrowserURL(GURL* url, TabContentsType* type) { 25 bool BrowserURLHandler::HandleBrowserURL(GURL* url, TabContentsType* type) {
29 if (url_handlers_.empty()) 26 if (url_handlers_.empty())
30 InitURLHandlers(); 27 InitURLHandlers();
31 for (size_t i = 0; i < url_handlers_.size(); ++i) { 28 for (size_t i = 0; i < url_handlers_.size(); ++i) {
32 if ((*url_handlers_[i])(url, type)) 29 if ((*url_handlers_[i])(url, type))
33 return true; 30 return true;
34 } 31 }
35 return false; 32 return false;
36 } 33 }
37 34
38
OLDNEW
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/debugger/debugger_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698