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/ui/extensions/extension_install_ui_default.h" | 5 #include "chrome/browser/ui/extensions/extension_install_ui_default.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 int ErrorInfoBarDelegate::GetButtons() const { | 124 int ErrorInfoBarDelegate::GetButtons() const { |
125 return BUTTON_OK; | 125 return BUTTON_OK; |
126 } | 126 } |
127 | 127 |
128 base::string16 ErrorInfoBarDelegate::GetLinkText() const { | 128 base::string16 ErrorInfoBarDelegate::GetLinkText() const { |
129 return (error_.type() == extensions::CrxInstallerError::ERROR_OFF_STORE) ? | 129 return (error_.type() == extensions::CrxInstallerError::ERROR_OFF_STORE) ? |
130 l10n_util::GetStringUTF16(IDS_LEARN_MORE) : base::string16(); | 130 l10n_util::GetStringUTF16(IDS_LEARN_MORE) : base::string16(); |
131 } | 131 } |
132 | 132 |
133 bool ErrorInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { | 133 bool ErrorInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { |
134 web_contents()->OpenURL(content::OpenURLParams( | 134 InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL( |
135 GURL("http://support.google.com/chrome_webstore/?p=crx_warning"), | 135 content::OpenURLParams( |
136 content::Referrer(), | 136 GURL("http://support.google.com/chrome_webstore/?p=crx_warning"), |
137 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 137 content::Referrer(), |
138 content::PAGE_TRANSITION_LINK, false)); | 138 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 139 content::PAGE_TRANSITION_LINK, false)); |
139 return false; | 140 return false; |
140 } | 141 } |
141 | 142 |
142 } // namespace | 143 } // namespace |
143 | 144 |
144 | 145 |
145 // ExtensionInstallUI --------------------------------------------------------- | 146 // ExtensionInstallUI --------------------------------------------------------- |
146 | 147 |
147 // static | 148 // static |
148 ExtensionInstallUI* ExtensionInstallUI::Create(Profile* profile) { | 149 ExtensionInstallUI* ExtensionInstallUI::Create(Profile* profile) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 browser->tab_strip_model()->GetActiveWebContents(); | 289 browser->tab_strip_model()->GetActiveWebContents(); |
289 if (!web_contents) | 290 if (!web_contents) |
290 return; | 291 return; |
291 ErrorInfoBarDelegate::Create(InfoBarService::FromWebContents(web_contents), | 292 ErrorInfoBarDelegate::Create(InfoBarService::FromWebContents(web_contents), |
292 error); | 293 error); |
293 } | 294 } |
294 | 295 |
295 void ExtensionInstallUIDefault::SetUseAppInstalledBubble(bool use_bubble) { | 296 void ExtensionInstallUIDefault::SetUseAppInstalledBubble(bool use_bubble) { |
296 use_app_installed_bubble_ = use_bubble; | 297 use_app_installed_bubble_ = use_bubble; |
297 } | 298 } |
OLD | NEW |