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/plugin_observer.h" | 5 #include "chrome/browser/plugin_observer.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
9 #include "chrome/browser/google/google_util.h" | 9 #include "chrome/browser/google/google_util.h" |
10 #include "chrome/browser/plugin_installer_infobar_delegate.h" | 10 #include "chrome/browser/plugin_installer_infobar_delegate.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 PluginInfoBarDelegate::~PluginInfoBarDelegate() { | 64 PluginInfoBarDelegate::~PluginInfoBarDelegate() { |
65 } | 65 } |
66 | 66 |
67 bool PluginInfoBarDelegate::Cancel() { | 67 bool PluginInfoBarDelegate::Cancel() { |
68 tab_contents_->render_view_host()->Send(new ViewMsg_LoadBlockedPlugins( | 68 tab_contents_->render_view_host()->Send(new ViewMsg_LoadBlockedPlugins( |
69 tab_contents_->render_view_host()->routing_id())); | 69 tab_contents_->render_view_host()->routing_id())); |
70 return true; | 70 return true; |
71 } | 71 } |
72 | 72 |
73 bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { | 73 bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { |
74 if (disposition == CURRENT_TAB) | 74 tab_contents_->OpenURL( |
75 disposition = NEW_FOREGROUND_TAB; | 75 google_util::AppendGoogleLocaleParam(GURL(GetLearnMoreURL())), GURL(), |
76 GURL url = google_util::AppendGoogleLocaleParam(GURL(GetLearnMoreURL())); | 76 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
77 tab_contents_->OpenURL(url, GURL(), disposition, PageTransition::LINK); | 77 PageTransition::LINK); |
78 return false; | 78 return false; |
79 } | 79 } |
80 | 80 |
81 gfx::Image* PluginInfoBarDelegate::GetIcon() const { | 81 gfx::Image* PluginInfoBarDelegate::GetIcon() const { |
82 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 82 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
83 IDR_INFOBAR_PLUGIN_INSTALL); | 83 IDR_INFOBAR_PLUGIN_INSTALL); |
84 } | 84 } |
85 | 85 |
86 string16 PluginInfoBarDelegate::GetLinkText() const { | 86 string16 PluginInfoBarDelegate::GetLinkText() const { |
87 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | 87 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 true)); | 356 true)); |
357 } | 357 } |
358 | 358 |
359 void PluginObserver::OnBlockedOutdatedPlugin(const string16& name, | 359 void PluginObserver::OnBlockedOutdatedPlugin(const string16& name, |
360 const GURL& update_url) { | 360 const GURL& update_url) { |
361 tab_contents_->AddInfoBar(update_url.is_empty() ? | 361 tab_contents_->AddInfoBar(update_url.is_empty() ? |
362 static_cast<InfoBarDelegate*>(new BlockedPluginInfoBarDelegate( | 362 static_cast<InfoBarDelegate*>(new BlockedPluginInfoBarDelegate( |
363 tab_contents(), name)) : | 363 tab_contents(), name)) : |
364 new OutdatedPluginInfoBarDelegate(tab_contents(), name, update_url)); | 364 new OutdatedPluginInfoBarDelegate(tab_contents(), name, update_url)); |
365 } | 365 } |
OLD | NEW |