Chromium Code Reviews| 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/utf_string_conversions.h" | |
| 8 #include "chrome/common/url_constants.h" | |
| 9 #include "content/browser/tab_contents/tab_contents.h" | |
| 10 #include "grit/generated_resources.h" | |
| 11 #include "ui/base/l10n/l10n_util.h" | |
| 12 | |
| 13 RegisterIntentHandlerInfoBarDelegate::RegisterIntentHandlerInfoBarDelegate( | |
| 14 TabContents* tab_contents) | |
| 15 : ConfirmInfoBarDelegate(tab_contents), | |
| 16 tab_contents_(tab_contents) { | |
| 17 } | |
| 18 | |
| 19 InfoBarDelegate::Type | |
| 20 RegisterIntentHandlerInfoBarDelegate::GetInfoBarType() const { | |
|
Peter Kasting
2011/07/26 22:08:32
Nit: Indent 4
James Hawkins
2011/07/26 22:35:39
Done. Perhaps this should be added to the style gu
| |
| 21 return PAGE_ACTION_TYPE; | |
| 22 } | |
| 23 | |
| 24 string16 RegisterIntentHandlerInfoBarDelegate::GetMessageText() const { | |
| 25 return l10n_util::GetStringFUTF16(IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM, | |
| 26 string16(), string16()); | |
| 27 } | |
| 28 | |
| 29 int RegisterIntentHandlerInfoBarDelegate::GetButtons() const { | |
| 30 return BUTTON_OK | BUTTON_CANCEL | BUTTON_NONE; | |
|
Peter Kasting
2011/07/26 22:08:32
This doesn't work. BUTTON_NONE is zero, not a sep
James Hawkins
2011/07/26 22:35:39
There's an open question in the design doc about u
| |
| 31 } | |
| 32 | |
| 33 string16 RegisterIntentHandlerInfoBarDelegate::GetButtonLabel( | |
| 34 InfoBarButton button) const { | |
| 35 switch (button) { | |
| 36 case BUTTON_OK: | |
| 37 return l10n_util::GetStringUTF16(IDS_REGISTER_INTENT_HANDLER_ACCEPT); | |
| 38 case BUTTON_CANCEL: | |
| 39 return l10n_util::GetStringFUTF16(IDS_REGISTER_INTENT_HANDLER_DENY, | |
| 40 string16()); | |
| 41 case BUTTON_NONE: | |
| 42 return l10n_util::GetStringFUTF16(IDS_REGISTER_INTENT_HANDLER_NEVER, | |
| 43 string16()); | |
| 44 } | |
| 45 | |
| 46 NOTREACHED(); | |
| 47 return string16(); | |
| 48 } | |
| 49 | |
| 50 string16 RegisterIntentHandlerInfoBarDelegate::GetLinkText() const { | |
| 51 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | |
| 52 } | |
| 53 | |
| 54 bool RegisterIntentHandlerInfoBarDelegate::LinkClicked( | |
| 55 WindowOpenDisposition disposition) { | |
| 56 // TODO(jhawkins): Open the Web Intents Help Center article once it is | |
| 57 // written. | |
| 58 // TODO(jhawkins): Add associated bug for the article here. | |
| 59 return false; | |
| 60 } | |
| OLD | NEW |