OLD | NEW |
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; | 72 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; |
73 | 73 |
74 private: | 74 private: |
75 ~HistoryUIHTMLSource(); | 75 ~HistoryUIHTMLSource(); |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(HistoryUIHTMLSource); | 77 DISALLOW_COPY_AND_ASSIGN(HistoryUIHTMLSource); |
78 }; | 78 }; |
79 | 79 |
80 HistoryUIHTMLSource::HistoryUIHTMLSource() | 80 HistoryUIHTMLSource::HistoryUIHTMLSource() |
81 : ChromeWebUIDataSource(chrome::kChromeUIHistoryHost) { | 81 : ChromeWebUIDataSource(chrome::kChromeUIHistoryFrameHost) { |
82 AddLocalizedString("loading", IDS_HISTORY_LOADING); | 82 AddLocalizedString("loading", IDS_HISTORY_LOADING); |
83 AddLocalizedString("title", IDS_HISTORY_TITLE); | 83 AddLocalizedString("title", IDS_HISTORY_TITLE); |
84 AddLocalizedString("newest", IDS_HISTORY_NEWEST); | 84 AddLocalizedString("newest", IDS_HISTORY_NEWEST); |
85 AddLocalizedString("newer", IDS_HISTORY_NEWER); | 85 AddLocalizedString("newer", IDS_HISTORY_NEWER); |
86 AddLocalizedString("older", IDS_HISTORY_OLDER); | 86 AddLocalizedString("older", IDS_HISTORY_OLDER); |
87 AddLocalizedString("searchresultsfor", IDS_HISTORY_SEARCHRESULTSFOR); | 87 AddLocalizedString("searchresultsfor", IDS_HISTORY_SEARCHRESULTSFOR); |
88 AddLocalizedString("history", IDS_HISTORY_BROWSERESULTS); | 88 AddLocalizedString("history", IDS_HISTORY_BROWSERESULTS); |
89 AddLocalizedString("cont", IDS_HISTORY_CONTINUED); | 89 AddLocalizedString("cont", IDS_HISTORY_CONTINUED); |
90 AddLocalizedString("searchbutton", IDS_HISTORY_SEARCH_BUTTON); | 90 AddLocalizedString("searchbutton", IDS_HISTORY_SEARCH_BUTTON); |
91 AddLocalizedString("noresults", IDS_HISTORY_NO_RESULTS); | 91 AddLocalizedString("noresults", IDS_HISTORY_NO_RESULTS); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 // | 421 // |
422 // HistoryUI | 422 // HistoryUI |
423 // | 423 // |
424 //////////////////////////////////////////////////////////////////////////////// | 424 //////////////////////////////////////////////////////////////////////////////// |
425 | 425 |
426 HistoryUI::HistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 426 HistoryUI::HistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
427 web_ui->AddMessageHandler(new BrowsingHistoryHandler()); | 427 web_ui->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-frame/ source. |
432 Profile* profile = Profile::FromWebUI(web_ui); | 432 Profile* profile = Profile::FromWebUI(web_ui); |
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 } |
OLD | NEW |