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/prefs/pref_service.h" | 5 #include "chrome/browser/prefs/pref_service.h" |
6 #include "chrome/browser/profiles/profile.h" | 6 #include "chrome/browser/profiles/profile.h" |
7 #include "chrome/browser/ui/browser_list.h" | 7 #include "chrome/browser/ui/browser_list.h" |
8 #include "chrome/browser/ui/browser_window.h" | 8 #include "chrome/browser/ui/browser_window.h" |
9 #include "chrome/browser/ui/find_bar/find_bar.h" | 9 #include "chrome/browser/ui/find_bar/find_bar.h" |
10 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 10 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 } | 673 } |
674 | 674 |
675 // DownloadManager::Observer | 675 // DownloadManager::Observer |
676 virtual void ModelChanged() { | 676 virtual void ModelChanged() { |
677 std::vector<DownloadItem*> downloads; | 677 std::vector<DownloadItem*> downloads; |
678 download_manager_->SearchDownloads(string16(), &downloads); | 678 download_manager_->SearchDownloads(string16(), &downloads); |
679 if (downloads.empty()) | 679 if (downloads.empty()) |
680 return; | 680 return; |
681 | 681 |
682 EXPECT_EQ(1U, downloads.size()); | 682 EXPECT_EQ(1U, downloads.size()); |
683 downloads.front()->Cancel(false); // Don't actually need to download it. | 683 downloads.front()->Cancel(); // Don't actually need to download it. |
684 | 684 |
685 saw_download_ = true; | 685 saw_download_ = true; |
686 EXPECT_TRUE(waiting_); | 686 EXPECT_TRUE(waiting_); |
687 MessageLoopForUI::current()->Quit(); | 687 MessageLoopForUI::current()->Quit(); |
688 } | 688 } |
689 | 689 |
690 private: | 690 private: |
691 DownloadManager* download_manager_; | 691 DownloadManager* download_manager_; |
692 bool saw_download_; | 692 bool saw_download_; |
693 bool waiting_; | 693 bool waiting_; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 EXPECT_EQ(1, tabbed_browser->tab_count()); | 786 EXPECT_EQ(1, tabbed_browser->tab_count()); |
787 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); | 787 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); |
788 tabbed_browser->CloseWindow(); | 788 tabbed_browser->CloseWindow(); |
789 #endif | 789 #endif |
790 | 790 |
791 EXPECT_EQ(1, panel_browser->tab_count()); | 791 EXPECT_EQ(1, panel_browser->tab_count()); |
792 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); | 792 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); |
793 | 793 |
794 panel_browser->CloseWindow(); | 794 panel_browser->CloseWindow(); |
795 } | 795 } |
OLD | NEW |