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

Side by Side Diff: chrome/browser/ui/webui/history_ui.cc

Issue 9188056: Start splitting out WebUI into an implementation class and an interface that each page implements... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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/ui/webui/history_ui.h ('k') | chrome/browser/ui/webui/html_dialog_ui.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/history_ui.h" 5 #include "chrome/browser/ui/webui/history_ui.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 web_ui()->CallJavascriptFunction("historyDeleted"); 416 web_ui()->CallJavascriptFunction("historyDeleted");
417 } 417 }
418 } 418 }
419 419
420 //////////////////////////////////////////////////////////////////////////////// 420 ////////////////////////////////////////////////////////////////////////////////
421 // 421 //
422 // HistoryUI 422 // HistoryUI
423 // 423 //
424 //////////////////////////////////////////////////////////////////////////////// 424 ////////////////////////////////////////////////////////////////////////////////
425 425
426 HistoryUI::HistoryUI(WebContents* contents) : WebUI(contents) { 426 HistoryUI::HistoryUI(WebContents* contents) : WebUI(contents, this) {
427 AddMessageHandler(new BrowsingHistoryHandler()); 427 AddMessageHandler(new BrowsingHistoryHandler());
428 428
429 HistoryUIHTMLSource* html_source = new HistoryUIHTMLSource(); 429 HistoryUIHTMLSource* html_source = new HistoryUIHTMLSource();
430 430
431 // Set up the chrome://history/ source. 431 // Set up the chrome://history/ source.
432 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); 432 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
433 profile->GetChromeURLDataManager()->AddDataSource(html_source); 433 profile->GetChromeURLDataManager()->AddDataSource(html_source);
434 } 434 }
435 435
436 // static 436 // static
437 const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) { 437 const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) {
438 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + 438 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" +
439 net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); 439 net::EscapeQueryParamValue(UTF16ToUTF8(text), true));
440 } 440 }
441 441
442 // static 442 // static
443 RefCountedMemory* HistoryUI::GetFaviconResourceBytes() { 443 RefCountedMemory* HistoryUI::GetFaviconResourceBytes() {
444 return ResourceBundle::GetSharedInstance(). 444 return ResourceBundle::GetSharedInstance().
445 LoadDataResourceBytes(IDR_HISTORY_FAVICON); 445 LoadDataResourceBytes(IDR_HISTORY_FAVICON);
446 } 446 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/history_ui.h ('k') | chrome/browser/ui/webui/html_dialog_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698