| OLD | NEW |
| 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/dom_ui/history_ui.h" | 5 #include "chrome/browser/dom_ui/history_ui.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string_piece.h" | 8 #include "base/string_piece.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/thread.h" | 10 #include "base/thread.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 // Create our favicon data source. | 109 // Create our favicon data source. |
| 110 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, | 110 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, |
| 111 NewRunnableMethod(&chrome_url_data_manager, | 111 NewRunnableMethod(&chrome_url_data_manager, |
| 112 &ChromeURLDataManager::AddDataSource, | 112 &ChromeURLDataManager::AddDataSource, |
| 113 new DOMUIFavIconSource(dom_ui_->GetProfile()))); | 113 new DOMUIFavIconSource(dom_ui_->GetProfile()))); |
| 114 | 114 |
| 115 // Get notifications when history is cleared. | 115 // Get notifications when history is cleared. |
| 116 NotificationService* service = NotificationService::current(); | 116 NotificationService* service = NotificationService::current(); |
| 117 service->AddObserver(this, NotificationType::HISTORY_URLS_DELETED, | 117 service->AddObserver(this, NotificationType::HISTORY_URLS_DELETED, |
| 118 Source<Profile>(dom_ui_->GetProfile())); | 118 Source<Profile>( |
| 119 dom_ui_->GetProfile()->GetOriginalProfile())); |
| 119 } | 120 } |
| 120 | 121 |
| 121 BrowsingHistoryHandler::~BrowsingHistoryHandler() { | 122 BrowsingHistoryHandler::~BrowsingHistoryHandler() { |
| 122 cancelable_consumer_.CancelAllRequests(); | 123 cancelable_consumer_.CancelAllRequests(); |
| 123 | 124 |
| 124 NotificationService* service = NotificationService::current(); | 125 NotificationService* service = NotificationService::current(); |
| 125 service->RemoveObserver(this, NotificationType::HISTORY_URLS_DELETED, | 126 service->RemoveObserver(this, NotificationType::HISTORY_URLS_DELETED, |
| 126 Source<Profile>(dom_ui_->GetProfile())); | 127 Source<Profile>( |
| 128 dom_ui_->GetProfile()->GetOriginalProfile())); |
| 127 | 129 |
| 128 if (remover_.get()) | 130 if (remover_.get()) |
| 129 remover_->RemoveObserver(this); | 131 remover_->RemoveObserver(this); |
| 130 } | 132 } |
| 131 | 133 |
| 132 void BrowsingHistoryHandler::HandleGetHistory(const Value* value) { | 134 void BrowsingHistoryHandler::HandleGetHistory(const Value* value) { |
| 133 // Anything in-flight is invalid. | 135 // Anything in-flight is invalid. |
| 134 cancelable_consumer_.CancelAllRequests(); | 136 cancelable_consumer_.CancelAllRequests(); |
| 135 | 137 |
| 136 // Get arguments (if any). | 138 // Get arguments (if any). |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 NewRunnableMethod(&chrome_url_data_manager, | 372 NewRunnableMethod(&chrome_url_data_manager, |
| 371 &ChromeURLDataManager::AddDataSource, | 373 &ChromeURLDataManager::AddDataSource, |
| 372 html_source)); | 374 html_source)); |
| 373 } | 375 } |
| 374 | 376 |
| 375 // static | 377 // static |
| 376 const GURL HistoryUI::GetHistoryURLWithSearchText(const std::wstring& text) { | 378 const GURL HistoryUI::GetHistoryURLWithSearchText(const std::wstring& text) { |
| 377 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + | 379 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + |
| 378 EscapeQueryParamValue(WideToUTF8(text))); | 380 EscapeQueryParamValue(WideToUTF8(text))); |
| 379 } | 381 } |
| OLD | NEW |