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 { | |
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 string16 RegisterIntentHandlerInfoBarDelegate::GetButtonLabel( | |
30 InfoBarButton button) const { | |
31 if (button == BUTTON_OK) { | |
32 return l10n_util::GetStringFUTF16(IDS_REGISTER_INTENT_HANDLER_ACCEPT, | |
33 string16(), string16()); | |
Peter Kasting
2011/07/26 23:10:52
Only one string16(), I believe?
James Hawkins
2011/07/26 23:18:26
Indeed, I was looking at the wrong string. Done.
| |
34 } else if (button == BUTTON_CANCEL) { | |
Peter Kasting
2011/07/26 23:10:52
Nit: No else after return.
Doing this with a cond
James Hawkins
2011/07/26 23:18:26
Done.
| |
35 return l10n_util::GetStringUTF16(IDS_REGISTER_INTENT_HANDLER_DENY); | |
36 } | |
37 | |
38 NOTREACHED(); | |
39 return string16(); | |
40 } | |
41 | |
42 string16 RegisterIntentHandlerInfoBarDelegate::GetLinkText() const { | |
43 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | |
44 } | |
45 | |
46 bool RegisterIntentHandlerInfoBarDelegate::LinkClicked( | |
47 WindowOpenDisposition disposition) { | |
48 // TODO(jhawkins): Open the Web Intents Help Center article once it is | |
49 // written. | |
50 // TODO(jhawkins): Add associated bug for the article here. | |
51 return false; | |
52 } | |
OLD | NEW |