| 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_installer_infobar_delegate.h" | 5 #include "chrome/browser/plugin_installer_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "chrome/browser/google/google_util.h" | 7 #include "chrome/browser/google/google_util.h" |
| 8 #include "chrome/browser/infobars/infobar_tab_helper.h" | 8 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 9 #include "content/browser/renderer_host/render_view_host.h" | 9 #include "content/browser/renderer_host/render_view_host.h" |
| 10 #include "content/browser/tab_contents/tab_contents.h" | 10 #include "content/browser/tab_contents/tab_contents.h" |
| 11 #include "grit/generated_resources.h" | 11 #include "grit/generated_resources.h" |
| 12 #include "grit/locale_settings.h" | 12 #include "grit/locale_settings.h" |
| 13 #include "grit/theme_resources_standard.h" | 13 #include "grit/theme_resources_standard.h" |
| 14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 15 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
| 16 | 16 |
| 17 PluginInstallerInfoBarDelegate::PluginInstallerInfoBarDelegate( | 17 PluginInstallerInfoBarDelegate::PluginInstallerInfoBarDelegate( |
| 18 PluginInstaller* installer, |
| 18 InfoBarTabHelper* infobar_helper, | 19 InfoBarTabHelper* infobar_helper, |
| 19 const string16& plugin_name, | 20 const string16& plugin_name, |
| 20 const GURL& learn_more_url, | 21 const GURL& learn_more_url, |
| 21 const base::Closure& callback) | 22 const base::Closure& callback) |
| 22 : ConfirmInfoBarDelegate(infobar_helper), | 23 : ConfirmInfoBarDelegate(infobar_helper), |
| 24 PluginInstallerObserver(installer), |
| 23 plugin_name_(plugin_name), | 25 plugin_name_(plugin_name), |
| 24 learn_more_url_(learn_more_url), | 26 learn_more_url_(learn_more_url), |
| 25 callback_(callback) { | 27 callback_(callback) { |
| 26 } | 28 } |
| 27 | 29 |
| 28 PluginInstallerInfoBarDelegate::~PluginInstallerInfoBarDelegate() { | 30 PluginInstallerInfoBarDelegate::~PluginInstallerInfoBarDelegate() { |
| 29 } | 31 } |
| 30 | 32 |
| 31 gfx::Image* PluginInstallerInfoBarDelegate::GetIcon() const { | 33 gfx::Image* PluginInstallerInfoBarDelegate::GetIcon() const { |
| 32 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 34 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 if (url.is_empty()) { | 74 if (url.is_empty()) { |
| 73 url = google_util::AppendGoogleLocaleParam(GURL( | 75 url = google_util::AppendGoogleLocaleParam(GURL( |
| 74 "https://www.google.com/support/chrome/bin/answer.py?answer=142064")); | 76 "https://www.google.com/support/chrome/bin/answer.py?answer=142064")); |
| 75 } | 77 } |
| 76 owner()->tab_contents()->OpenURL( | 78 owner()->tab_contents()->OpenURL( |
| 77 url, GURL(), | 79 url, GURL(), |
| 78 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 80 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 79 content::PAGE_TRANSITION_LINK); | 81 content::PAGE_TRANSITION_LINK); |
| 80 return false; | 82 return false; |
| 81 } | 83 } |
| 84 |
| 85 void PluginInstallerInfoBarDelegate::DidStartDownload() { |
| 86 owner()->RemoveInfoBar(this); |
| 87 } |
| OLD | NEW |