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/test/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 ui_controls::SendMouseEvents(button, state); | 708 ui_controls::SendMouseEvents(button, state); |
709 } | 709 } |
710 | 710 |
711 } // namespace internal | 711 } // namespace internal |
712 | 712 |
713 HistoryEnumerator::HistoryEnumerator(Profile* profile) { | 713 HistoryEnumerator::HistoryEnumerator(Profile* profile) { |
714 scoped_refptr<content::MessageLoopRunner> message_loop_runner = | 714 scoped_refptr<content::MessageLoopRunner> message_loop_runner = |
715 new content::MessageLoopRunner; | 715 new content::MessageLoopRunner; |
716 | 716 |
717 HistoryService* hs = HistoryServiceFactory::GetForProfile( | 717 HistoryService* hs = HistoryServiceFactory::GetForProfile( |
718 profile, Profile::EXPLICIT_ACCESS); | 718 profile, Profile::EXPLICIT_ACCESS).get(); |
719 hs->QueryHistory( | 719 hs->QueryHistory( |
720 string16(), | 720 string16(), |
721 history::QueryOptions(), | 721 history::QueryOptions(), |
722 &consumer_, | 722 &consumer_, |
723 base::Bind(&HistoryEnumerator::HistoryQueryComplete, | 723 base::Bind(&HistoryEnumerator::HistoryQueryComplete, |
724 base::Unretained(this), message_loop_runner->QuitClosure())); | 724 base::Unretained(this), message_loop_runner->QuitClosure())); |
725 message_loop_runner->Run(); | 725 message_loop_runner->Run(); |
726 } | 726 } |
727 | 727 |
728 HistoryEnumerator::~HistoryEnumerator() {} | 728 HistoryEnumerator::~HistoryEnumerator() {} |
729 | 729 |
730 void HistoryEnumerator::HistoryQueryComplete( | 730 void HistoryEnumerator::HistoryQueryComplete( |
731 const base::Closure& quit_task, | 731 const base::Closure& quit_task, |
732 HistoryService::Handle request_handle, | 732 HistoryService::Handle request_handle, |
733 history::QueryResults* results) { | 733 history::QueryResults* results) { |
734 for (size_t i = 0; i < results->size(); ++i) | 734 for (size_t i = 0; i < results->size(); ++i) |
735 urls_.push_back((*results)[i].url()); | 735 urls_.push_back((*results)[i].url()); |
736 quit_task.Run(); | 736 quit_task.Run(); |
737 } | 737 } |
738 | 738 |
739 } // namespace ui_test_utils | 739 } // namespace ui_test_utils |
OLD | NEW |