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/plugins/plugin_observer.h" | 5 #include "chrome/browser/plugins/plugin_observer.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 InfoBarService* infobar_service = | 289 InfoBarService* infobar_service = |
290 InfoBarService::FromWebContents(web_contents()); | 290 InfoBarService::FromWebContents(web_contents()); |
291 InfoBarDelegate* delegate; | 291 InfoBarDelegate* delegate; |
292 #if !defined(OS_WIN) | 292 #if !defined(OS_WIN) |
293 delegate = PluginInstallerInfoBarDelegate::Create( | 293 delegate = PluginInstallerInfoBarDelegate::Create( |
294 infobar_service, installer, plugin_metadata.Pass(), callback); | 294 infobar_service, installer, plugin_metadata.Pass(), callback); |
295 #else | 295 #else |
296 delegate = base::win::IsMetroProcess() ? | 296 delegate = base::win::IsMetroProcess() ? |
297 new PluginMetroModeInfoBarDelegate( | 297 new PluginMetroModeInfoBarDelegate( |
298 infobar_service, | 298 infobar_service, |
299 l10n_util::GetStringFUTF16(IDS_METRO_MISSING_PLUGIN_PROMPT, | 299 PluginMetroModeInfoBarDelegate::MISSING_PLUGIN, |
300 plugin_metadata->name()), | 300 plugin_metadata->name()) : |
301 l10n_util::GetStringUTF16(IDS_WIN8_DESKTOP_RESTART), | |
302 GURL("https://support.google.com/chrome/?ib_display_in_desktop"), | |
303 false) : | |
304 PluginInstallerInfoBarDelegate::Create( | 301 PluginInstallerInfoBarDelegate::Create( |
305 infobar_service, installer, plugin_metadata.Pass(), callback); | 302 infobar_service, installer, plugin_metadata.Pass(), callback); |
306 #endif | 303 #endif |
307 infobar_service->AddInfoBar(delegate); | 304 infobar_service->AddInfoBar(delegate); |
308 } | 305 } |
309 | 306 |
310 void PluginObserver::InstallMissingPlugin( | 307 void PluginObserver::InstallMissingPlugin( |
311 PluginInstaller* installer, | 308 PluginInstaller* installer, |
312 const PluginMetadata* plugin_metadata) { | 309 const PluginMetadata* plugin_metadata) { |
313 if (plugin_metadata->url_for_display()) { | 310 if (plugin_metadata->url_for_display()) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 identifier, NULL, &plugin)) { | 373 identifier, NULL, &plugin)) { |
377 NOTREACHED(); | 374 NOTREACHED(); |
378 return; | 375 return; |
379 } | 376 } |
380 | 377 |
381 InfoBarService* infobar_service = | 378 InfoBarService* infobar_service = |
382 InfoBarService::FromWebContents(web_contents()); | 379 InfoBarService::FromWebContents(web_contents()); |
383 infobar_service->AddInfoBar( | 380 infobar_service->AddInfoBar( |
384 new PluginMetroModeInfoBarDelegate( | 381 new PluginMetroModeInfoBarDelegate( |
385 infobar_service, | 382 infobar_service, |
386 l10n_util::GetStringFUTF16(IDS_METRO_NPAPI_PLUGIN_PROMPT, | 383 PluginMetroModeInfoBarDelegate::DESKTOP_MODE_REQUIRED, |
387 plugin->name()), | 384 plugin->name())); |
388 l10n_util::GetStringUTF16(IDS_WIN8_RESTART), | |
389 GURL("https://support.google.com/chrome/?ib_redirect_to_desktop"), | |
390 true)); | |
391 #else | 385 #else |
392 NOTREACHED(); | 386 NOTREACHED(); |
393 #endif | 387 #endif |
394 } | 388 } |
OLD | NEW |