| OLD | NEW |
| 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/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/infobars/infobar_tab_helper.h" | 9 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 bool RegisterProtocolHandlerInfoBarDelegate::LinkClicked( | 90 bool RegisterProtocolHandlerInfoBarDelegate::LinkClicked( |
| 91 WindowOpenDisposition disposition) { | 91 WindowOpenDisposition disposition) { |
| 92 content::RecordAction( | 92 content::RecordAction( |
| 93 UserMetricsAction("RegisterProtocolHandler.InfoBar_LearnMore")); | 93 UserMetricsAction("RegisterProtocolHandler.InfoBar_LearnMore")); |
| 94 OpenURLParams params( | 94 OpenURLParams params( |
| 95 GURL(chrome::kLearnMoreRegisterProtocolHandlerURL), | 95 GURL(chrome::kLearnMoreRegisterProtocolHandlerURL), |
| 96 Referrer(), | 96 Referrer(), |
| 97 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 97 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
| 98 content::PAGE_TRANSITION_LINK, | 98 content::PAGE_TRANSITION_LINK, |
| 99 false); | 99 false); |
| 100 owner()->web_contents()->OpenURL(params); | 100 owner()->GetWebContents()->OpenURL(params); |
| 101 return false; | 101 return false; |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool RegisterProtocolHandlerInfoBarDelegate::IsReplacedBy( | 104 bool RegisterProtocolHandlerInfoBarDelegate::IsReplacedBy( |
| 105 RegisterProtocolHandlerInfoBarDelegate* delegate) { | 105 RegisterProtocolHandlerInfoBarDelegate* delegate) { |
| 106 return handler_.IsEquivalent(delegate->handler_); | 106 return handler_.IsEquivalent(delegate->handler_); |
| 107 } | 107 } |
| 108 | 108 |
| 109 RegisterProtocolHandlerInfoBarDelegate* | 109 RegisterProtocolHandlerInfoBarDelegate* |
| 110 RegisterProtocolHandlerInfoBarDelegate:: | 110 RegisterProtocolHandlerInfoBarDelegate:: |
| 111 AsRegisterProtocolHandlerInfoBarDelegate() { | 111 AsRegisterProtocolHandlerInfoBarDelegate() { |
| 112 return this; | 112 return this; |
| 113 } | 113 } |
| OLD | NEW |