| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 252 |
| 253 HistoryService* hs = | 253 HistoryService* hs = |
| 254 Profile::FromWebUI(web_ui())->GetHistoryService(Profile::EXPLICIT_ACCESS); | 254 Profile::FromWebUI(web_ui())->GetHistoryService(Profile::EXPLICIT_ACCESS); |
| 255 hs->ExpireHistoryBetween( | 255 hs->ExpireHistoryBetween( |
| 256 urls_to_be_deleted_, begin_time, end_time, &cancelable_delete_consumer_, | 256 urls_to_be_deleted_, begin_time, end_time, &cancelable_delete_consumer_, |
| 257 base::Bind(&BrowsingHistoryHandler::RemoveComplete, | 257 base::Bind(&BrowsingHistoryHandler::RemoveComplete, |
| 258 base::Unretained(this))); | 258 base::Unretained(this))); |
| 259 } | 259 } |
| 260 | 260 |
| 261 void BrowsingHistoryHandler::HandleClearBrowsingData(const ListValue* args) { | 261 void BrowsingHistoryHandler::HandleClearBrowsingData(const ListValue* args) { |
| 262 #if defined(OS_ANDROID) |
| 263 NOTIMPLEMENTED() << "TODO(yfriedman): Upstream the Android version."; |
| 264 #else |
| 262 // TODO(beng): This is an improper direct dependency on Browser. Route this | 265 // TODO(beng): This is an improper direct dependency on Browser. Route this |
| 263 // through some sort of delegate. | 266 // through some sort of delegate. |
| 264 Profile* profile = Profile::FromWebUI(web_ui()); | 267 Profile* profile = Profile::FromWebUI(web_ui()); |
| 265 Browser* browser = BrowserList::FindBrowserWithProfile(profile); | 268 Browser* browser = BrowserList::FindBrowserWithProfile(profile); |
| 266 if (browser) | 269 if (browser) |
| 267 browser->OpenClearBrowsingDataDialog(); | 270 browser->OpenClearBrowsingDataDialog(); |
| 271 #endif |
| 268 } | 272 } |
| 269 | 273 |
| 270 void BrowsingHistoryHandler::QueryComplete( | 274 void BrowsingHistoryHandler::QueryComplete( |
| 271 HistoryService::Handle request_handle, | 275 HistoryService::Handle request_handle, |
| 272 history::QueryResults* results) { | 276 history::QueryResults* results) { |
| 273 | 277 |
| 274 ListValue results_value; | 278 ListValue results_value; |
| 275 base::Time midnight_today = base::Time::Now().LocalMidnight(); | 279 base::Time midnight_today = base::Time::Now().LocalMidnight(); |
| 276 | 280 |
| 277 for (size_t i = 0; i < results->size(); ++i) { | 281 for (size_t i = 0; i < results->size(); ++i) { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) { | 441 const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) { |
| 438 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + | 442 return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + |
| 439 net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); | 443 net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); |
| 440 } | 444 } |
| 441 | 445 |
| 442 // static | 446 // static |
| 443 RefCountedMemory* HistoryUI::GetFaviconResourceBytes() { | 447 RefCountedMemory* HistoryUI::GetFaviconResourceBytes() { |
| 444 return ResourceBundle::GetSharedInstance(). | 448 return ResourceBundle::GetSharedInstance(). |
| 445 LoadDataResourceBytes(IDR_HISTORY_FAVICON); | 449 LoadDataResourceBytes(IDR_HISTORY_FAVICON); |
| 446 } | 450 } |
| OLD | NEW |