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

Side by Side Diff: chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc

Issue 7545021: Unify infobars' link-opening behavior to respect user-requested dispositions and append the Googl... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/geolocation/chrome_geolocation_permission_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/custom_handlers/register_protocol_handler_infobar_deleg ate.h" 5 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg ate.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
9 #include "chrome/browser/google/google_util.h"
9 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
10 #include "content/browser/tab_contents/tab_contents.h" 11 #include "content/browser/tab_contents/tab_contents.h"
11 #include "grit/generated_resources.h" 12 #include "grit/generated_resources.h"
12 #include "ui/base/l10n/l10n_util.h" 13 #include "ui/base/l10n/l10n_util.h"
13 14
14 RegisterProtocolHandlerInfoBarDelegate::RegisterProtocolHandlerInfoBarDelegate( 15 RegisterProtocolHandlerInfoBarDelegate::RegisterProtocolHandlerInfoBarDelegate(
15 TabContents* tab_contents, 16 TabContents* tab_contents,
16 ProtocolHandlerRegistry* registry, 17 ProtocolHandlerRegistry* registry,
17 const ProtocolHandler& handler) 18 const ProtocolHandler& handler)
18 : ConfirmInfoBarDelegate(tab_contents), 19 : ConfirmInfoBarDelegate(tab_contents),
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 registry_->OnIgnoreRegisterProtocolHandler(handler_); 77 registry_->OnIgnoreRegisterProtocolHandler(handler_);
77 return true; 78 return true;
78 } 79 }
79 80
80 string16 RegisterProtocolHandlerInfoBarDelegate::GetLinkText() const { 81 string16 RegisterProtocolHandlerInfoBarDelegate::GetLinkText() const {
81 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); 82 return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
82 } 83 }
83 84
84 bool RegisterProtocolHandlerInfoBarDelegate::LinkClicked( 85 bool RegisterProtocolHandlerInfoBarDelegate::LinkClicked(
85 WindowOpenDisposition disposition) { 86 WindowOpenDisposition disposition) {
86 // Ignore the click dispostion and always open in a new top level tab. 87 tab_contents_->OpenURL(google_util::AppendGoogleLocaleParam(GURL(
87 tab_contents_->OpenURL(GURL(chrome::kLearnMoreRegisterProtocolHandlerURL), 88 chrome::kLearnMoreRegisterProtocolHandlerURL)), GURL(),
88 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); 89 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
90 PageTransition::LINK);
89 return false; 91 return false;
90 } 92 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/geolocation/chrome_geolocation_permission_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698