| 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 Profile* profile = Profile::FromWebUI(web_ui()); | 475 Profile* profile = Profile::FromWebUI(web_ui()); |
| 476 | 476 |
| 477 // Anything in-flight is invalid. | 477 // Anything in-flight is invalid. |
| 478 query_task_tracker_.TryCancelAll(); | 478 query_task_tracker_.TryCancelAll(); |
| 479 web_history_request_.reset(); | 479 web_history_request_.reset(); |
| 480 | 480 |
| 481 query_results_.clear(); | 481 query_results_.clear(); |
| 482 results_info_value_.Clear(); | 482 results_info_value_.Clear(); |
| 483 | 483 |
| 484 HistoryService* hs = HistoryServiceFactory::GetForProfile( | 484 HistoryService* hs = HistoryServiceFactory::GetForProfile( |
| 485 profile, Profile::EXPLICIT_ACCESS); | 485 profile, ServiceAccessType::EXPLICIT_ACCESS); |
| 486 hs->QueryHistory(search_text, | 486 hs->QueryHistory(search_text, |
| 487 options, | 487 options, |
| 488 base::Bind(&BrowsingHistoryHandler::QueryComplete, | 488 base::Bind(&BrowsingHistoryHandler::QueryComplete, |
| 489 base::Unretained(this), | 489 base::Unretained(this), |
| 490 search_text, | 490 search_text, |
| 491 options), | 491 options), |
| 492 &query_task_tracker_); | 492 &query_task_tracker_); |
| 493 | 493 |
| 494 history::WebHistoryService* web_history = | 494 history::WebHistoryService* web_history = |
| 495 WebHistoryServiceFactory::GetForProfile(profile); | 495 WebHistoryServiceFactory::GetForProfile(profile); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 Profile* profile = Profile::FromWebUI(web_ui()); | 563 Profile* profile = Profile::FromWebUI(web_ui()); |
| 564 // TODO(davidben): history.js is not aware of this failure and will still | 564 // TODO(davidben): history.js is not aware of this failure and will still |
| 565 // override |deleteCompleteCallback_|. | 565 // override |deleteCompleteCallback_|. |
| 566 if (delete_task_tracker_.HasTrackedTasks() || | 566 if (delete_task_tracker_.HasTrackedTasks() || |
| 567 has_pending_delete_request_ || | 567 has_pending_delete_request_ || |
| 568 !profile->GetPrefs()->GetBoolean(prefs::kAllowDeletingBrowserHistory)) { | 568 !profile->GetPrefs()->GetBoolean(prefs::kAllowDeletingBrowserHistory)) { |
| 569 web_ui()->CallJavascriptFunction("deleteFailed"); | 569 web_ui()->CallJavascriptFunction("deleteFailed"); |
| 570 return; | 570 return; |
| 571 } | 571 } |
| 572 | 572 |
| 573 HistoryService* history_service = | 573 HistoryService* history_service = HistoryServiceFactory::GetForProfile( |
| 574 HistoryServiceFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS); | 574 profile, ServiceAccessType::EXPLICIT_ACCESS); |
| 575 history::WebHistoryService* web_history = | 575 history::WebHistoryService* web_history = |
| 576 WebHistoryServiceFactory::GetForProfile(profile); | 576 WebHistoryServiceFactory::GetForProfile(profile); |
| 577 | 577 |
| 578 base::Time now = base::Time::Now(); | 578 base::Time now = base::Time::Now(); |
| 579 std::vector<history::ExpireHistoryArgs> expire_list; | 579 std::vector<history::ExpireHistoryArgs> expire_list; |
| 580 expire_list.reserve(args->GetSize()); | 580 expire_list.reserve(args->GetSize()); |
| 581 | 581 |
| 582 DCHECK(urls_to_be_deleted_.empty()); | 582 DCHECK(urls_to_be_deleted_.empty()); |
| 583 for (base::ListValue::const_iterator it = args->begin(); | 583 for (base::ListValue::const_iterator it = args->begin(); |
| 584 it != args->end(); ++it) { | 584 it != args->end(); ++it) { |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 Profile* profile = Profile::FromWebUI(web_ui); | 1034 Profile* profile = Profile::FromWebUI(web_ui); |
| 1035 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); | 1035 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 // static | 1038 // static |
| 1039 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( | 1039 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( |
| 1040 ui::ScaleFactor scale_factor) { | 1040 ui::ScaleFactor scale_factor) { |
| 1041 return ResourceBundle::GetSharedInstance(). | 1041 return ResourceBundle::GetSharedInstance(). |
| 1042 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); | 1042 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); |
| 1043 } | 1043 } |
| OLD | NEW |