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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "chrome/browser/bookmarks/bookmark_utils.h" | 34 #include "chrome/browser/bookmarks/bookmark_utils.h" |
35 #include "chrome/browser/browser_process.h" | 35 #include "chrome/browser/browser_process.h" |
36 #include "chrome/browser/browser_shutdown.h" | 36 #include "chrome/browser/browser_shutdown.h" |
37 #include "chrome/browser/character_encoding.h" | 37 #include "chrome/browser/character_encoding.h" |
38 #include "chrome/browser/chrome_page_zoom.h" | 38 #include "chrome/browser/chrome_page_zoom.h" |
39 #include "chrome/browser/content_settings/host_content_settings_map.h" | 39 #include "chrome/browser/content_settings/host_content_settings_map.h" |
40 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 40 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
41 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" | 41 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" |
42 #include "chrome/browser/debugger/devtools_toggle_action.h" | 42 #include "chrome/browser/debugger/devtools_toggle_action.h" |
43 #include "chrome/browser/debugger/devtools_window.h" | 43 #include "chrome/browser/debugger/devtools_window.h" |
44 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 44 #include "chrome/browser/download/download_crx_util.h" |
45 #include "chrome/browser/download/download_item_model.h" | 45 #include "chrome/browser/download/download_item_model.h" |
46 #include "chrome/browser/download/download_service.h" | 46 #include "chrome/browser/download/download_service.h" |
47 #include "chrome/browser/download/download_service_factory.h" | 47 #include "chrome/browser/download/download_service_factory.h" |
48 #include "chrome/browser/download/download_shelf.h" | 48 #include "chrome/browser/download/download_shelf.h" |
49 #include "chrome/browser/download/download_started_animation.h" | 49 #include "chrome/browser/download/download_started_animation.h" |
50 #include "chrome/browser/download/download_util.h" | 50 #include "chrome/browser/download/download_util.h" |
51 #include "chrome/browser/extensions/browser_extension_window_controller.h" | 51 #include "chrome/browser/extensions/browser_extension_window_controller.h" |
52 #include "chrome/browser/extensions/crx_installer.h" | 52 #include "chrome/browser/extensions/crx_installer.h" |
53 #include "chrome/browser/extensions/default_apps_trial.h" | 53 #include "chrome/browser/extensions/default_apps_trial.h" |
54 #include "chrome/browser/extensions/extension_prefs.h" | 54 #include "chrome/browser/extensions/extension_prefs.h" |
(...skipping 3338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3393 shelf->AddDownload(new DownloadItemModel(download)); | 3393 shelf->AddDownload(new DownloadItemModel(download)); |
3394 // Don't show the animation for "Save file" downloads. | 3394 // Don't show the animation for "Save file" downloads. |
3395 // For non-theme extensions, we don't show the download animation. | 3395 // For non-theme extensions, we don't show the download animation. |
3396 // Show animation in same window as the download shelf. Download shelf | 3396 // Show animation in same window as the download shelf. Download shelf |
3397 // may not be in the same window that initiated the download, e.g. | 3397 // may not be in the same window that initiated the download, e.g. |
3398 // Panels. | 3398 // Panels. |
3399 // Don't show the animation if the selected tab is not visible (i.e. the | 3399 // Don't show the animation if the selected tab is not visible (i.e. the |
3400 // window is minimized, we're in a unit test, etc.). | 3400 // window is minimized, we're in a unit test, etc.). |
3401 WebContents* shelf_tab = shelf->browser()->GetSelectedWebContents(); | 3401 WebContents* shelf_tab = shelf->browser()->GetSelectedWebContents(); |
3402 if ((download->GetTotalBytes() > 0) && | 3402 if ((download->GetTotalBytes() > 0) && |
3403 !ChromeDownloadManagerDelegate::IsExtensionDownload(download) && | 3403 !download_crx_util::IsExtensionDownload(*download) && |
3404 platform_util::IsVisible(shelf_tab->GetNativeView()) && | 3404 platform_util::IsVisible(shelf_tab->GetNativeView()) && |
3405 ui::Animation::ShouldRenderRichAnimation()) { | 3405 ui::Animation::ShouldRenderRichAnimation()) { |
3406 DownloadStartedAnimation::Show(shelf_tab); | 3406 DownloadStartedAnimation::Show(shelf_tab); |
3407 } | 3407 } |
3408 } | 3408 } |
3409 | 3409 |
3410 // If the download occurs in a new tab, close it. | 3410 // If the download occurs in a new tab, close it. |
3411 if (source->GetController().IsInitialNavigation() && tab_count() > 1) | 3411 if (source->GetController().IsInitialNavigation() && tab_count() > 1) |
3412 CloseContents(source); | 3412 CloseContents(source); |
3413 } | 3413 } |
(...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5109 if (contents && !allow_js_access) { | 5109 if (contents && !allow_js_access) { |
5110 contents->web_contents()->GetController().LoadURL( | 5110 contents->web_contents()->GetController().LoadURL( |
5111 target_url, | 5111 target_url, |
5112 content::Referrer(), | 5112 content::Referrer(), |
5113 content::PAGE_TRANSITION_LINK, | 5113 content::PAGE_TRANSITION_LINK, |
5114 std::string()); // No extra headers. | 5114 std::string()); // No extra headers. |
5115 } | 5115 } |
5116 | 5116 |
5117 return contents != NULL; | 5117 return contents != NULL; |
5118 } | 5118 } |
OLD | NEW |