OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
11 | 11 |
12 #include <algorithm> | 12 #include <algorithm> |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "app/animation.h" | |
16 #include "app/l10n_util.h" | 15 #include "app/l10n_util.h" |
17 #include "base/base_paths.h" | 16 #include "base/base_paths.h" |
18 #include "base/command_line.h" | 17 #include "base/command_line.h" |
19 #include "base/logging.h" | 18 #include "base/logging.h" |
20 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
21 #include "base/path_service.h" | 20 #include "base/path_service.h" |
22 #include "base/string_util.h" | 21 #include "base/string_util.h" |
23 #include "base/threading/thread.h" | 22 #include "base/threading/thread.h" |
24 #include "base/threading/thread_restrictions.h" | 23 #include "base/threading/thread_restrictions.h" |
25 #include "base/utf_string_conversions.h" | 24 #include "base/utf_string_conversions.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 #include "chrome/common/url_constants.h" | 100 #include "chrome/common/url_constants.h" |
102 #include "chrome/common/web_apps.h" | 101 #include "chrome/common/web_apps.h" |
103 #include "grit/chromium_strings.h" | 102 #include "grit/chromium_strings.h" |
104 #include "grit/generated_resources.h" | 103 #include "grit/generated_resources.h" |
105 #include "grit/locale_settings.h" | 104 #include "grit/locale_settings.h" |
106 #include "net/base/cookie_monster.h" | 105 #include "net/base/cookie_monster.h" |
107 #include "net/base/net_util.h" | 106 #include "net/base/net_util.h" |
108 #include "net/base/registry_controlled_domain.h" | 107 #include "net/base/registry_controlled_domain.h" |
109 #include "net/base/static_cookie_policy.h" | 108 #include "net/base/static_cookie_policy.h" |
110 #include "net/url_request/url_request_context.h" | 109 #include "net/url_request/url_request_context.h" |
| 110 #include "ui/base/animation/animation.h" |
111 #include "webkit/glue/webkit_glue.h" | 111 #include "webkit/glue/webkit_glue.h" |
112 #include "webkit/glue/window_open_disposition.h" | 112 #include "webkit/glue/window_open_disposition.h" |
113 | 113 |
114 #if defined(OS_WIN) | 114 #if defined(OS_WIN) |
115 #include "app/win/shell.h" | 115 #include "app/win/shell.h" |
116 #include "chrome/browser/autofill/autofill_ie_toolbar_import_win.h" | 116 #include "chrome/browser/autofill/autofill_ie_toolbar_import_win.h" |
117 #include "chrome/browser/browser_child_process_host.h" | 117 #include "chrome/browser/browser_child_process_host.h" |
118 #include "chrome/browser/download/save_package.h" | 118 #include "chrome/browser/download/save_package.h" |
119 #include "chrome/browser/ssl/ssl_error_info.h" | 119 #include "chrome/browser/ssl/ssl_error_info.h" |
120 #include "chrome/browser/shell_integration.h" | 120 #include "chrome/browser/shell_integration.h" |
(...skipping 2932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3053 return; | 3053 return; |
3054 | 3054 |
3055 // For non-theme extensions, we don't show the download animation. | 3055 // For non-theme extensions, we don't show the download animation. |
3056 if (download->is_extension_install() && | 3056 if (download->is_extension_install() && |
3057 !ExtensionService::IsDownloadFromMiniGallery(download->url())) | 3057 !ExtensionService::IsDownloadFromMiniGallery(download->url())) |
3058 return; | 3058 return; |
3059 | 3059 |
3060 TabContents* current_tab = GetSelectedTabContents(); | 3060 TabContents* current_tab = GetSelectedTabContents(); |
3061 // We make this check for the case of minimized windows, unit tests, etc. | 3061 // We make this check for the case of minimized windows, unit tests, etc. |
3062 if (platform_util::IsVisible(current_tab->GetNativeView()) && | 3062 if (platform_util::IsVisible(current_tab->GetNativeView()) && |
3063 Animation::ShouldRenderRichAnimation()) { | 3063 ui::Animation::ShouldRenderRichAnimation()) { |
3064 DownloadStartedAnimation::Show(current_tab); | 3064 DownloadStartedAnimation::Show(current_tab); |
3065 } | 3065 } |
3066 #endif | 3066 #endif |
3067 | 3067 |
3068 // If the download occurs in a new tab, close it | 3068 // If the download occurs in a new tab, close it |
3069 if (tab->controller().IsInitialNavigation() && | 3069 if (tab->controller().IsInitialNavigation() && |
3070 GetConstrainingContents(tab) == tab && tab_count() > 1) { | 3070 GetConstrainingContents(tab) == tab && tab_count() > 1) { |
3071 CloseContents(tab); | 3071 CloseContents(tab); |
3072 } | 3072 } |
3073 } | 3073 } |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4235 // The page transition below is only for the purpose of inserting the tab. | 4235 // The page transition below is only for the purpose of inserting the tab. |
4236 browser->AddTab(view_source_contents, PageTransition::LINK); | 4236 browser->AddTab(view_source_contents, PageTransition::LINK); |
4237 } | 4237 } |
4238 | 4238 |
4239 if (profile_->HasSessionService()) { | 4239 if (profile_->HasSessionService()) { |
4240 SessionService* session_service = profile_->GetSessionService(); | 4240 SessionService* session_service = profile_->GetSessionService(); |
4241 if (session_service) | 4241 if (session_service) |
4242 session_service->TabRestored(&view_source_contents->controller(), false); | 4242 session_service->TabRestored(&view_source_contents->controller(), false); |
4243 } | 4243 } |
4244 } | 4244 } |
OLD | NEW |