OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "content/browser/tab_contents/tab_contents.h" |
| 9 #include "grit/generated_resources.h" |
| 10 #include "ui/base/l10n/l10n_util.h" |
| 11 |
| 12 RegisterIntentHandlerInfoBarDelegate::RegisterIntentHandlerInfoBarDelegate( |
| 13 TabContents* tab_contents) |
| 14 : ConfirmInfoBarDelegate(tab_contents), |
| 15 tab_contents_(tab_contents) { |
| 16 } |
| 17 |
| 18 InfoBarDelegate::Type |
| 19 RegisterIntentHandlerInfoBarDelegate::GetInfoBarType() const { |
| 20 return PAGE_ACTION_TYPE; |
| 21 } |
| 22 |
| 23 string16 RegisterIntentHandlerInfoBarDelegate::GetMessageText() const { |
| 24 return l10n_util::GetStringFUTF16(IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM, |
| 25 string16(), string16()); |
| 26 } |
| 27 |
| 28 string16 RegisterIntentHandlerInfoBarDelegate::GetButtonLabel( |
| 29 InfoBarButton button) const { |
| 30 if (button == BUTTON_OK) { |
| 31 return l10n_util::GetStringFUTF16(IDS_REGISTER_INTENT_HANDLER_ACCEPT, |
| 32 string16()); |
| 33 } |
| 34 |
| 35 DCHECK(button == BUTTON_CANCEL); |
| 36 return l10n_util::GetStringUTF16(IDS_REGISTER_INTENT_HANDLER_DENY); |
| 37 } |
| 38 |
| 39 string16 RegisterIntentHandlerInfoBarDelegate::GetLinkText() const { |
| 40 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
| 41 } |
| 42 |
| 43 bool RegisterIntentHandlerInfoBarDelegate::LinkClicked( |
| 44 WindowOpenDisposition disposition) { |
| 45 // TODO(jhawkins): Open the Web Intents Help Center article once it is |
| 46 // written. |
| 47 // TODO(jhawkins): Add associated bug for the article here. |
| 48 return false; |
| 49 } |
OLD | NEW |