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/api/app/app_api.h" | 51 #include "chrome/browser/extensions/api/app/app_api.h" |
52 #include "chrome/browser/extensions/browser_extension_window_controller.h" | 52 #include "chrome/browser/extensions/browser_extension_window_controller.h" |
53 #include "chrome/browser/extensions/crx_installer.h" | 53 #include "chrome/browser/extensions/crx_installer.h" |
54 #include "chrome/browser/extensions/default_apps_trial.h" | 54 #include "chrome/browser/extensions/default_apps_trial.h" |
(...skipping 3349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3404 shelf->AddDownload(new DownloadItemModel(download)); | 3404 shelf->AddDownload(new DownloadItemModel(download)); |
3405 // Don't show the animation for "Save file" downloads. | 3405 // Don't show the animation for "Save file" downloads. |
3406 // For non-theme extensions, we don't show the download animation. | 3406 // For non-theme extensions, we don't show the download animation. |
3407 // Show animation in same window as the download shelf. Download shelf | 3407 // Show animation in same window as the download shelf. Download shelf |
3408 // may not be in the same window that initiated the download, e.g. | 3408 // may not be in the same window that initiated the download, e.g. |
3409 // Panels. | 3409 // Panels. |
3410 // Don't show the animation if the selected tab is not visible (i.e. the | 3410 // Don't show the animation if the selected tab is not visible (i.e. the |
3411 // window is minimized, we're in a unit test, etc.). | 3411 // window is minimized, we're in a unit test, etc.). |
3412 WebContents* shelf_tab = shelf->browser()->GetSelectedWebContents(); | 3412 WebContents* shelf_tab = shelf->browser()->GetSelectedWebContents(); |
3413 if ((download->GetTotalBytes() > 0) && | 3413 if ((download->GetTotalBytes() > 0) && |
3414 !ChromeDownloadManagerDelegate::IsExtensionDownload(download) && | 3414 !download_crx_util::IsExtensionDownload(*download) && |
3415 platform_util::IsVisible(shelf_tab->GetNativeView()) && | 3415 platform_util::IsVisible(shelf_tab->GetNativeView()) && |
3416 ui::Animation::ShouldRenderRichAnimation()) { | 3416 ui::Animation::ShouldRenderRichAnimation()) { |
3417 DownloadStartedAnimation::Show(shelf_tab); | 3417 DownloadStartedAnimation::Show(shelf_tab); |
3418 } | 3418 } |
3419 } | 3419 } |
3420 | 3420 |
3421 // If the download occurs in a new tab, close it. | 3421 // If the download occurs in a new tab, close it. |
3422 if (source->GetController().IsInitialNavigation() && tab_count() > 1) | 3422 if (source->GetController().IsInitialNavigation() && tab_count() > 1) |
3423 CloseContents(source); | 3423 CloseContents(source); |
3424 } | 3424 } |
(...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5121 if (contents && !allow_js_access) { | 5121 if (contents && !allow_js_access) { |
5122 contents->web_contents()->GetController().LoadURL( | 5122 contents->web_contents()->GetController().LoadURL( |
5123 target_url, | 5123 target_url, |
5124 content::Referrer(), | 5124 content::Referrer(), |
5125 content::PAGE_TRANSITION_LINK, | 5125 content::PAGE_TRANSITION_LINK, |
5126 std::string()); // No extra headers. | 5126 std::string()); // No extra headers. |
5127 } | 5127 } |
5128 | 5128 |
5129 return contents != NULL; | 5129 return contents != NULL; |
5130 } | 5130 } |
OLD | NEW |