Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: chrome/browser/ui/extensions/extension_install_ui_default.cc

Issue 230453004: Remove InfoBarDelegate::web_contents() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 content::WebContents* web_contents =
135 InfoBarService::WebContentsFromInfoBar(infobar());
136 web_contents->OpenURL(content::OpenURLParams(
135 GURL("http://support.google.com/chrome_webstore/?p=crx_warning"), 137 GURL("http://support.google.com/chrome_webstore/?p=crx_warning"),
136 content::Referrer(), 138 content::Referrer(),
137 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, 139 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
138 content::PAGE_TRANSITION_LINK, false)); 140 content::PAGE_TRANSITION_LINK, false));
139 return false; 141 return false;
140 } 142 }
141 143
142 } // namespace 144 } // namespace
143 145
144 146
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 browser->tab_strip_model()->GetActiveWebContents(); 290 browser->tab_strip_model()->GetActiveWebContents();
289 if (!web_contents) 291 if (!web_contents)
290 return; 292 return;
291 ErrorInfoBarDelegate::Create(InfoBarService::FromWebContents(web_contents), 293 ErrorInfoBarDelegate::Create(InfoBarService::FromWebContents(web_contents),
292 error); 294 error);
293 } 295 }
294 296
295 void ExtensionInstallUIDefault::SetUseAppInstalledBubble(bool use_bubble) { 297 void ExtensionInstallUIDefault::SetUseAppInstalledBubble(bool use_bubble) {
296 use_app_installed_bubble_ = use_bubble; 298 use_app_installed_bubble_ = use_bubble;
297 } 299 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698