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/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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 #include "chrome/common/profiling.h" | 128 #include "chrome/common/profiling.h" |
129 #include "chrome/common/url_constants.h" | 129 #include "chrome/common/url_constants.h" |
130 #include "chrome/common/web_apps.h" | 130 #include "chrome/common/web_apps.h" |
131 #include "content/browser/browser_url_handler.h" | 131 #include "content/browser/browser_url_handler.h" |
132 #include "content/browser/child_process_security_policy.h" | 132 #include "content/browser/child_process_security_policy.h" |
133 #include "content/browser/debugger/devtools_manager.h" | 133 #include "content/browser/debugger/devtools_manager.h" |
134 #include "content/browser/download/download_item.h" | 134 #include "content/browser/download/download_item.h" |
135 #include "content/browser/download/download_manager.h" | 135 #include "content/browser/download/download_manager.h" |
136 #include "content/browser/download/save_package.h" | 136 #include "content/browser/download/save_package.h" |
137 #include "content/browser/host_zoom_map.h" | 137 #include "content/browser/host_zoom_map.h" |
| 138 #include "content/browser/plugin_service.h" |
138 #include "content/browser/renderer_host/render_view_host.h" | 139 #include "content/browser/renderer_host/render_view_host.h" |
139 #include "content/browser/site_instance.h" | 140 #include "content/browser/site_instance.h" |
140 #include "content/browser/tab_contents/interstitial_page.h" | 141 #include "content/browser/tab_contents/interstitial_page.h" |
141 #include "content/browser/tab_contents/navigation_controller.h" | 142 #include "content/browser/tab_contents/navigation_controller.h" |
142 #include "content/browser/tab_contents/navigation_entry.h" | 143 #include "content/browser/tab_contents/navigation_entry.h" |
143 #include "content/browser/tab_contents/tab_contents_view.h" | 144 #include "content/browser/tab_contents/tab_contents_view.h" |
144 #include "content/browser/user_metrics.h" | 145 #include "content/browser/user_metrics.h" |
145 #include "content/common/content_restriction.h" | 146 #include "content/common/content_restriction.h" |
146 #include "content/common/content_switches.h" | 147 #include "content/common/content_switches.h" |
147 #include "content/common/notification_service.h" | 148 #include "content/common/notification_service.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 #include "chrome/browser/chromeos/boot_times_loader.h" | 181 #include "chrome/browser/chromeos/boot_times_loader.h" |
181 #include "chrome/browser/ui/webui/active_downloads_ui.h" | 182 #include "chrome/browser/ui/webui/active_downloads_ui.h" |
182 #else | 183 #else |
183 #include "chrome/browser/download/download_shelf.h" | 184 #include "chrome/browser/download/download_shelf.h" |
184 #endif | 185 #endif |
185 | 186 |
186 #if defined(FILE_MANAGER_EXTENSION) | 187 #if defined(FILE_MANAGER_EXTENSION) |
187 #include "chrome/browser/extensions/file_manager_util.h" | 188 #include "chrome/browser/extensions/file_manager_util.h" |
188 #endif | 189 #endif |
189 | 190 |
190 #include "webkit/plugins/npapi/plugin_list.h" | |
191 | |
192 using base::TimeDelta; | 191 using base::TimeDelta; |
193 | 192 |
194 /////////////////////////////////////////////////////////////////////////////// | 193 /////////////////////////////////////////////////////////////////////////////// |
195 | 194 |
196 namespace { | 195 namespace { |
197 | 196 |
198 // The URL to be loaded to display Help. | 197 // The URL to be loaded to display Help. |
199 const char kHelpContentUrl[] = | 198 const char kHelpContentUrl[] = |
200 #if defined(OS_CHROMEOS) | 199 #if defined(OS_CHROMEOS) |
201 #if defined(OFFICIAL_BUILD) | 200 #if defined(OFFICIAL_BUILD) |
(...skipping 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2509 const FilePath& plugin_path) { | 2508 const FilePath& plugin_path) { |
2510 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( | 2509 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( |
2511 tab); | 2510 tab); |
2512 if (!tcw) | 2511 if (!tcw) |
2513 return; | 2512 return; |
2514 | 2513 |
2515 DCHECK(!plugin_path.value().empty()); | 2514 DCHECK(!plugin_path.value().empty()); |
2516 | 2515 |
2517 string16 plugin_name = plugin_path.LossyDisplayName(); | 2516 string16 plugin_name = plugin_path.LossyDisplayName(); |
2518 webkit::WebPluginInfo plugin_info; | 2517 webkit::WebPluginInfo plugin_info; |
2519 if (webkit::npapi::PluginList::Singleton()->GetPluginInfoByPath( | 2518 CHECK(PluginService::GetInstance()->GetPluginInfoByPath(plugin_path, |
2520 plugin_path, &plugin_info) && | 2519 &plugin_info)); |
2521 !plugin_info.name.empty()) { | 2520 if (!plugin_info.name.empty()) { |
2522 plugin_name = plugin_info.name; | 2521 plugin_name = plugin_info.name; |
2523 #if defined(OS_MACOSX) | 2522 #if defined(OS_MACOSX) |
2524 // Many plugins on the Mac have .plugin in the actual name, which looks | 2523 // Many plugins on the Mac have .plugin in the actual name, which looks |
2525 // terrible, so look for that and strip it off if present. | 2524 // terrible, so look for that and strip it off if present. |
2526 const std::string kPluginExtension = ".plugin"; | 2525 const std::string kPluginExtension = ".plugin"; |
2527 if (EndsWith(plugin_name, ASCIIToUTF16(kPluginExtension), true)) | 2526 if (EndsWith(plugin_name, ASCIIToUTF16(kPluginExtension), true)) |
2528 plugin_name.erase(plugin_name.length() - kPluginExtension.length()); | 2527 plugin_name.erase(plugin_name.length() - kPluginExtension.length()); |
2529 #endif // OS_MACOSX | 2528 #endif // OS_MACOSX |
2530 } | 2529 } |
2531 gfx::Image* icon = &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 2530 gfx::Image* icon = &ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
(...skipping 2750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5282 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5281 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
5283 } else if (is_type_tabbed()) { | 5282 } else if (is_type_tabbed()) { |
5284 GlobalErrorService* service = | 5283 GlobalErrorService* service = |
5285 GlobalErrorServiceFactory::GetForProfile(profile()); | 5284 GlobalErrorServiceFactory::GetForProfile(profile()); |
5286 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5285 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
5287 if (error) { | 5286 if (error) { |
5288 error->ShowBubbleView(this); | 5287 error->ShowBubbleView(this); |
5289 } | 5288 } |
5290 } | 5289 } |
5291 } | 5290 } |
OLD | NEW |