From ef75c230a88acecbf9ae76829c6eb795a9815d74 Mon Sep 17 00:00:00 2001 From: "cpu@chromium.org" Date: Tue, 10 Jul 2012 04:06:42 +0000 Subject: [PATCH] Re-land https://src.chromium.org/viewvc/chrome?view=rev&revision=145774 It had green tries but I guess I missed an include Wires the "open in desktop" button of the metro plugin infobar It launches chrome in desktop (or creates a new tab) and transitions to desktop more. Also the help link is now final. TBR=ben BUG=133422 TEST= see bug comment 5 Review URL: https://chromiumcodereview.appspot.com/10758024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145838 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/plugin_infobar_delegates.cc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/chrome/browser/plugin_infobar_delegates.cc b/chrome/browser/plugin_infobar_delegates.cc index 1cdb6f7ece83..577a4fbebabf 100644 --- a/chrome/browser/plugin_infobar_delegates.cc +++ b/chrome/browser/plugin_infobar_delegates.cc @@ -22,6 +22,11 @@ #include "ui/base/resource/resource_bundle.h" #include "webkit/plugins/npapi/plugin_group.h" +#if defined(OS_WIN) +#include +#include "ui/base/win/shell.h" +#endif + #if defined(ENABLE_PLUGIN_INSTALLATION) #include "chrome/browser/plugin_installer.h" #endif // defined(ENABLE_PLUGIN_INSTALLATION) @@ -452,8 +457,19 @@ string16 PluginMetroModeInfoBarDelegate::GetButtonLabel( } bool PluginMetroModeInfoBarDelegate::Accept() { - // TODO(cpu) switch to desktop chrome here. - return false; + content::WebContents* web_contents = owner()->web_contents(); + if (!web_contents) + return false; + // Note that empty urls are not valid. + if (!web_contents->GetURL().is_valid()) + return false; + std::string url(web_contents->GetURL().spec()); + // This obscure use of the 'log usage' mask for windows 8 is documented + // here http://goo.gl/HBOe9. + ui::win::OpenAnyViaShell(UTF8ToUTF16(url), + string16(), + SEE_MASK_FLAG_LOG_USAGE); + return true; } string16 PluginMetroModeInfoBarDelegate::GetLinkText() const { @@ -464,7 +480,7 @@ bool PluginMetroModeInfoBarDelegate::LinkClicked( WindowOpenDisposition disposition) { // TODO(cpu): replace with the final url. GURL url = google_util::AppendGoogleLocaleParam(GURL( - "https://www.google.com/support/chrome/bin/answer.py?answer=142064")); + "https://support.google.com/chrome/?ib_display_in_desktop")); OpenURLParams params( url, Referrer(), (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, -- 2.11.4.GIT