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

Side by Side Diff: chrome/browser/plugins/plugin_infobar_delegates.cc

Issue 1584573004: Remove Metro pinning, and relaunch menu items and strings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 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
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/plugins/plugin_infobar_delegates.h" 5 #include "chrome/browser/plugins/plugin_infobar_delegates.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 scoped_ptr<PluginMetadata> plugin_metadata, 204 scoped_ptr<PluginMetadata> plugin_metadata,
205 const base::string16& message) { 205 const base::string16& message) {
206 DCHECK(infobar->owner()); 206 DCHECK(infobar->owner());
207 infobar->owner()->ReplaceInfoBar( 207 infobar->owner()->ReplaceInfoBar(
208 infobar, 208 infobar,
209 infobar->owner()->CreateConfirmInfoBar( 209 infobar->owner()->CreateConfirmInfoBar(
210 scoped_ptr<ConfirmInfoBarDelegate>(new OutdatedPluginInfoBarDelegate( 210 scoped_ptr<ConfirmInfoBarDelegate>(new OutdatedPluginInfoBarDelegate(
211 installer, plugin_metadata.Pass(), message)))); 211 installer, plugin_metadata.Pass(), message))));
212 } 212 }
213 213
214 #if defined(OS_WIN)
215
216 // PluginMetroModeInfoBarDelegate ---------------------------------------------
217
218 // static
219 void PluginMetroModeInfoBarDelegate::Create(
220 InfoBarService* infobar_service,
221 PluginMetroModeInfoBarDelegate::Mode mode,
222 const base::string16& name) {
223 infobar_service->AddInfoBar(
224 infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>(
225 new PluginMetroModeInfoBarDelegate(mode, name))));
226 }
227
228 PluginMetroModeInfoBarDelegate::PluginMetroModeInfoBarDelegate(
229 PluginMetroModeInfoBarDelegate::Mode mode,
230 const base::string16& name)
231 : ConfirmInfoBarDelegate(),
232 mode_(mode),
233 name_(name) {
234 }
235
236 PluginMetroModeInfoBarDelegate::~PluginMetroModeInfoBarDelegate() {
237 }
238
239 infobars::InfoBarDelegate::InfoBarIdentifier
240 PluginMetroModeInfoBarDelegate::GetIdentifier() const {
241 return PLUGIN_METRO_MODE_INFOBAR_DELEGATE;
242 }
243
244 int PluginMetroModeInfoBarDelegate::GetIconId() const {
245 return IDR_INFOBAR_PLUGIN_INSTALL;
246 }
247
248 base::string16 PluginMetroModeInfoBarDelegate::GetMessageText() const {
249 return l10n_util::GetStringFUTF16((mode_ == MISSING_PLUGIN) ?
250 IDS_METRO_MISSING_PLUGIN_PROMPT : IDS_METRO_NPAPI_PLUGIN_PROMPT, name_);
251 }
252
253 int PluginMetroModeInfoBarDelegate::GetButtons() const {
254 return BUTTON_OK;
255 }
256
257 base::string16 PluginMetroModeInfoBarDelegate::GetButtonLabel(
258 InfoBarButton button) const {
259 return l10n_util::GetStringUTF16(IDS_WIN_DESKTOP_RESTART);
260 }
261
262 void LaunchDesktopInstanceHelper(const base::string16& url) {
263 base::FilePath exe_path;
264 if (!PathService::Get(base::FILE_EXE, &exe_path))
265 return;
266 base::FilePath shortcut_path(
267 ShellIntegration::GetStartMenuShortcut(exe_path));
268
269 // Actually launching the process needs to happen in the metro viewer,
270 // otherwise it won't automatically transition to desktop. So we have
271 // to send an IPC to the viewer to do the ShellExecute.
272 aura::RemoteWindowTreeHostWin::Instance()->HandleOpenURLOnDesktop(
273 shortcut_path, url);
274 }
275
276 bool PluginMetroModeInfoBarDelegate::Accept() {
277 // TODO(scottmg): Remove this entire class http://crbug.com/558054.
278 return true;
279 }
280
281 base::string16 PluginMetroModeInfoBarDelegate::GetLinkText() const {
282 return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
283 }
284
285 GURL PluginMetroModeInfoBarDelegate::GetLinkURL() const {
286 return GURL(
287 (mode_ == MISSING_PLUGIN)
288 ? "https://support.google.com/chrome/?p=ib_display_in_desktop"
289 : "https://support.google.com/chrome/?p=ib_redirect_to_desktop");
290 }
291
292 #endif // defined(OS_WIN)
293
294 #endif // defined(ENABLE_PLUGIN_INSTALLATION) 214 #endif // defined(ENABLE_PLUGIN_INSTALLATION)
OLDNEW
« no previous file with comments | « chrome/browser/plugins/plugin_infobar_delegates.h ('k') | chrome/browser/plugins/plugin_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698