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 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 } | 883 } |
884 | 884 |
885 // DownloadManager::Observer | 885 // DownloadManager::Observer |
886 virtual void ModelChanged() { | 886 virtual void ModelChanged() { |
887 std::vector<DownloadItem*> downloads; | 887 std::vector<DownloadItem*> downloads; |
888 download_manager_->SearchDownloads(string16(), &downloads); | 888 download_manager_->SearchDownloads(string16(), &downloads); |
889 if (downloads.empty()) | 889 if (downloads.empty()) |
890 return; | 890 return; |
891 | 891 |
892 EXPECT_EQ(1U, downloads.size()); | 892 EXPECT_EQ(1U, downloads.size()); |
893 downloads.front()->Cancel(false); // Don't actually need to download it. | 893 downloads.front()->Cancel(); // Don't actually need to download it. |
894 | 894 |
895 saw_download_ = true; | 895 saw_download_ = true; |
896 EXPECT_TRUE(waiting_); | 896 EXPECT_TRUE(waiting_); |
897 MessageLoopForUI::current()->Quit(); | 897 MessageLoopForUI::current()->Quit(); |
898 } | 898 } |
899 | 899 |
900 private: | 900 private: |
901 DownloadManager* download_manager_; | 901 DownloadManager* download_manager_; |
902 bool saw_download_; | 902 bool saw_download_; |
903 bool waiting_; | 903 bool waiting_; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 EXPECT_EQ(1, tabbed_browser->tab_count()); | 996 EXPECT_EQ(1, tabbed_browser->tab_count()); |
997 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); | 997 ASSERT_TRUE(tabbed_browser->window()->IsDownloadShelfVisible()); |
998 tabbed_browser->CloseWindow(); | 998 tabbed_browser->CloseWindow(); |
999 #endif | 999 #endif |
1000 | 1000 |
1001 EXPECT_EQ(1, panel_browser->tab_count()); | 1001 EXPECT_EQ(1, panel_browser->tab_count()); |
1002 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); | 1002 ASSERT_FALSE(panel_browser->window()->IsDownloadShelfVisible()); |
1003 | 1003 |
1004 panel_browser->CloseWindow(); | 1004 panel_browser->CloseWindow(); |
1005 } | 1005 } |
OLD | NEW |