| 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 <sstream> | 5 #include <sstream> | 
| 6 | 6 | 
| 7 #include "base/bind.h" | 7 #include "base/bind.h" | 
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" | 
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" | 
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" | 
| 11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" | 
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" | 
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" | 
|  | 14 #include "base/prefs/pref_service.h" | 
| 14 #include "base/stl_util.h" | 15 #include "base/stl_util.h" | 
| 15 #include "base/stringprintf.h" | 16 #include "base/stringprintf.h" | 
| 16 #include "base/test/test_file_util.h" | 17 #include "base/test/test_file_util.h" | 
| 17 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" | 
| 18 #include "chrome/app/chrome_command_ids.h" | 19 #include "chrome/app/chrome_command_ids.h" | 
| 19 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" | 
| 20 #include "chrome/browser/common/cancelable_request.h" | 21 #include "chrome/browser/common/cancelable_request.h" | 
| 21 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 22 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 
| 22 #include "chrome/browser/download/download_crx_util.h" | 23 #include "chrome/browser/download/download_crx_util.h" | 
| 23 #include "chrome/browser/download/download_history.h" | 24 #include "chrome/browser/download/download_history.h" | 
| 24 #include "chrome/browser/download/download_item_model.h" | 25 #include "chrome/browser/download/download_item_model.h" | 
| 25 #include "chrome/browser/download/download_prefs.h" | 26 #include "chrome/browser/download/download_prefs.h" | 
| 26 #include "chrome/browser/download/download_request_limiter.h" | 27 #include "chrome/browser/download/download_request_limiter.h" | 
| 27 #include "chrome/browser/download/download_service.h" | 28 #include "chrome/browser/download/download_service.h" | 
| 28 #include "chrome/browser/download/download_service_factory.h" | 29 #include "chrome/browser/download/download_service_factory.h" | 
| 29 #include "chrome/browser/download/download_shelf.h" | 30 #include "chrome/browser/download/download_shelf.h" | 
| 30 #include "chrome/browser/download/download_test_file_activity_observer.h" | 31 #include "chrome/browser/download/download_test_file_activity_observer.h" | 
| 31 #include "chrome/browser/download/download_util.h" | 32 #include "chrome/browser/download/download_util.h" | 
| 32 #include "chrome/browser/extensions/extension_install_prompt.h" | 33 #include "chrome/browser/extensions/extension_install_prompt.h" | 
| 33 #include "chrome/browser/extensions/extension_service.h" | 34 #include "chrome/browser/extensions/extension_service.h" | 
| 34 #include "chrome/browser/extensions/extension_system.h" | 35 #include "chrome/browser/extensions/extension_system.h" | 
| 35 #include "chrome/browser/history/download_row.h" | 36 #include "chrome/browser/history/download_row.h" | 
| 36 #include "chrome/browser/history/history_service.h" | 37 #include "chrome/browser/history/history_service.h" | 
| 37 #include "chrome/browser/history/history_service_factory.h" | 38 #include "chrome/browser/history/history_service_factory.h" | 
| 38 #include "chrome/browser/net/url_request_mock_util.h" | 39 #include "chrome/browser/net/url_request_mock_util.h" | 
| 39 #include "chrome/browser/prefs/pref_service.h" |  | 
| 40 #include "chrome/browser/profiles/profile.h" | 40 #include "chrome/browser/profiles/profile.h" | 
| 41 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 41 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 
| 42 #include "chrome/browser/ui/browser.h" | 42 #include "chrome/browser/ui/browser.h" | 
| 43 #include "chrome/browser/ui/browser_commands.h" | 43 #include "chrome/browser/ui/browser_commands.h" | 
| 44 #include "chrome/browser/ui/browser_list.h" | 44 #include "chrome/browser/ui/browser_list.h" | 
| 45 #include "chrome/browser/ui/browser_tabstrip.h" | 45 #include "chrome/browser/ui/browser_tabstrip.h" | 
| 46 #include "chrome/browser/ui/browser_window.h" | 46 #include "chrome/browser/ui/browser_window.h" | 
| 47 #include "chrome/browser/ui/chrome_pages.h" | 47 #include "chrome/browser/ui/chrome_pages.h" | 
| 48 #include "chrome/browser/ui/host_desktop.h" | 48 #include "chrome/browser/ui/host_desktop.h" | 
| 49 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 49 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 
| (...skipping 2362 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2412       browser()->tab_strip_model()->GetActiveWebContents(); | 2412       browser()->tab_strip_model()->GetActiveWebContents(); | 
| 2413   scoped_ptr<DownloadUrlParameters> params( | 2413   scoped_ptr<DownloadUrlParameters> params( | 
| 2414       DownloadUrlParameters::FromWebContents(web_contents, url)); | 2414       DownloadUrlParameters::FromWebContents(web_contents, url)); | 
| 2415   params->set_callback(base::Bind(&SetHiddenDownloadCallback)); | 2415   params->set_callback(base::Bind(&SetHiddenDownloadCallback)); | 
| 2416   download_manager->DownloadUrl(params.Pass()); | 2416   download_manager->DownloadUrl(params.Pass()); | 
| 2417   observer->WaitForFinished(); | 2417   observer->WaitForFinished(); | 
| 2418 | 2418 | 
| 2419   // Verify that download shelf is not shown. | 2419   // Verify that download shelf is not shown. | 
| 2420   EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); | 2420   EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); | 
| 2421 } | 2421 } | 
| OLD | NEW | 
|---|