| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |