| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/history2_ui.h" | 5 #include "chrome/browser/ui/webui/history2_ui.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 BrowsingHistoryHandler2::~BrowsingHistoryHandler2() { | 125 BrowsingHistoryHandler2::~BrowsingHistoryHandler2() { |
| 126 cancelable_search_consumer_.CancelAllRequests(); | 126 cancelable_search_consumer_.CancelAllRequests(); |
| 127 cancelable_delete_consumer_.CancelAllRequests(); | 127 cancelable_delete_consumer_.CancelAllRequests(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 WebUIMessageHandler* BrowsingHistoryHandler2::Attach(WebUI* web_ui) { | 130 WebUIMessageHandler* BrowsingHistoryHandler2::Attach(WebUI* web_ui) { |
| 131 // Create our favicon data source. | 131 // Create our favicon data source. |
| 132 Profile* profile = web_ui->GetProfile(); | 132 Profile* profile = web_ui->GetProfile(); |
| 133 profile->GetChromeURLDataManager()->AddDataSource( | 133 profile->GetChromeURLDataManager()->AddDataSource( |
| 134 new FaviconSource(profile)); | 134 new FaviconSource(profile, chrome::kChromeUIFaviconHost)); |
| 135 | 135 |
| 136 // Get notifications when history is cleared. | 136 // Get notifications when history is cleared. |
| 137 registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED, | 137 registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED, |
| 138 Source<Profile>(web_ui->GetProfile()->GetOriginalProfile())); | 138 Source<Profile>(web_ui->GetProfile()->GetOriginalProfile())); |
| 139 return WebUIMessageHandler::Attach(web_ui); | 139 return WebUIMessageHandler::Attach(web_ui); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void BrowsingHistoryHandler2::RegisterMessages() { | 142 void BrowsingHistoryHandler2::RegisterMessages() { |
| 143 web_ui_->RegisterMessageCallback("getHistory", | 143 web_ui_->RegisterMessageCallback("getHistory", |
| 144 NewCallback(this, &BrowsingHistoryHandler2::HandleGetHistory)); | 144 NewCallback(this, &BrowsingHistoryHandler2::HandleGetHistory)); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 const GURL HistoryUI2::GetHistoryURLWithSearchText(const string16& text) { | 404 const GURL HistoryUI2::GetHistoryURLWithSearchText(const string16& text) { |
| 405 return GURL(std::string(chrome::kChromeUIHistory2URL) + "#q=" + | 405 return GURL(std::string(chrome::kChromeUIHistory2URL) + "#q=" + |
| 406 EscapeQueryParamValue(UTF16ToUTF8(text), true)); | 406 EscapeQueryParamValue(UTF16ToUTF8(text), true)); |
| 407 } | 407 } |
| 408 | 408 |
| 409 // static | 409 // static |
| 410 RefCountedMemory* HistoryUI2::GetFaviconResourceBytes() { | 410 RefCountedMemory* HistoryUI2::GetFaviconResourceBytes() { |
| 411 return ResourceBundle::GetSharedInstance(). | 411 return ResourceBundle::GetSharedInstance(). |
| 412 LoadDataResourceBytes(IDR_HISTORY_FAVICON); | 412 LoadDataResourceBytes(IDR_HISTORY_FAVICON); |
| 413 } | 413 } |
| OLD | NEW |