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_infobar_delegates.h" | 5 #include "chrome/browser/plugins/plugin_infobar_delegates.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/api/infobars/infobar_service.h" | 8 #include "chrome/browser/api/infobars/infobar_service.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/google/google_util.h" | 10 #include "chrome/browser/google/google_util.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 227 |
228 bool OutdatedPluginInfoBarDelegate::Accept() { | 228 bool OutdatedPluginInfoBarDelegate::Accept() { |
229 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Update")); | 229 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Update")); |
230 if (installer()->state() != PluginInstaller::INSTALLER_STATE_IDLE) { | 230 if (installer()->state() != PluginInstaller::INSTALLER_STATE_IDLE) { |
231 NOTREACHED(); | 231 NOTREACHED(); |
232 return false; | 232 return false; |
233 } | 233 } |
234 | 234 |
235 content::WebContents* web_contents = owner()->GetWebContents(); | 235 content::WebContents* web_contents = owner()->GetWebContents(); |
236 if (plugin_metadata_->url_for_display()) { | 236 if (plugin_metadata_->url_for_display()) { |
237 installer()->OpenDownloadURL(plugin_metadata_->url_for_display(), | 237 installer()->OpenDownloadURL(plugin_metadata_->plugin_url(), |
238 plugin_metadata_->plugin_url(), | |
239 web_contents); | 238 web_contents); |
240 } else { | 239 } else { |
241 installer()->StartInstalling( | 240 installer()->StartInstalling( |
242 plugin_metadata_->url_for_display(), | |
243 plugin_metadata_->plugin_url(), | 241 plugin_metadata_->plugin_url(), |
244 TabContents::FromWebContents(web_contents)); | 242 TabContents::FromWebContents(web_contents)); |
245 } | 243 } |
246 return false; | 244 return false; |
247 } | 245 } |
248 | 246 |
249 bool OutdatedPluginInfoBarDelegate::Cancel() { | 247 bool OutdatedPluginInfoBarDelegate::Cancel() { |
250 content::RecordAction( | 248 content::RecordAction( |
251 UserMetricsAction("OutdatedPluginInfobar.AllowThisTime")); | 249 UserMetricsAction("OutdatedPluginInfobar.AllowThisTime")); |
252 LoadBlockedPlugins(); | 250 LoadBlockedPlugins(); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 "https://support.google.com/chrome/?ib_display_in_desktop")); | 494 "https://support.google.com/chrome/?ib_display_in_desktop")); |
497 OpenURLParams params( | 495 OpenURLParams params( |
498 url, Referrer(), | 496 url, Referrer(), |
499 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 497 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
500 content::PAGE_TRANSITION_LINK, false); | 498 content::PAGE_TRANSITION_LINK, false); |
501 owner()->GetWebContents()->OpenURL(params); | 499 owner()->GetWebContents()->OpenURL(params); |
502 return false; | 500 return false; |
503 } | 501 } |
504 #endif // defined(OS_WIN) | 502 #endif // defined(OS_WIN) |
505 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 503 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
OLD | NEW |