OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame/turndown_prompt/turndown_prompt_window.h" | 5 #include "chrome_frame/turndown_prompt/turndown_prompt_window.h" |
6 | 6 |
7 #include <atlctrls.h> | 7 #include <atlctrls.h> |
8 #include <commctrl.h> | 8 #include <commctrl.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // Subclass the "Learn more." text to make it behave like a link. Clicks are | 44 // Subclass the "Learn more." text to make it behave like a link. Clicks are |
45 // routed to OnLearnMore(). | 45 // routed to OnLearnMore(). |
46 CWindow rte = instance->GetDlgItem(IDC_TD_PROMPT_LINK); | 46 CWindow rte = instance->GetDlgItem(IDC_TD_PROMPT_LINK); |
47 instance->link_.reset(new CHyperLink()); | 47 instance->link_.reset(new CHyperLink()); |
48 instance->link_->SubclassWindow(rte); | 48 instance->link_->SubclassWindow(rte); |
49 instance->link_->SetHyperLinkExtendedStyle(HLINK_NOTIFYBUTTON, | 49 instance->link_->SetHyperLinkExtendedStyle(HLINK_NOTIFYBUTTON, |
50 HLINK_NOTIFYBUTTON); | 50 HLINK_NOTIFYBUTTON); |
51 | 51 |
52 // Substitute the proper text given the current IE version. | 52 // Substitute the proper text given the current IE version. |
53 CWindow text = instance->GetDlgItem(IDC_TD_PROMPT_MESSAGE); | 53 CWindow text = instance->GetDlgItem(IDC_TD_PROMPT_MESSAGE); |
54 string16 prompt_text(GetPromptText()); | 54 base::string16 prompt_text(GetPromptText()); |
55 if (!prompt_text.empty()) | 55 if (!prompt_text.empty()) |
56 text.SetWindowText(prompt_text.c_str()); | 56 text.SetWindowText(prompt_text.c_str()); |
57 | 57 |
58 return instance; | 58 return instance; |
59 } | 59 } |
60 | 60 |
61 TurndownPromptWindow::TurndownPromptWindow( | 61 TurndownPromptWindow::TurndownPromptWindow( |
62 InfobarContent::Frame* frame, | 62 InfobarContent::Frame* frame, |
63 UrlLauncher* url_launcher, | 63 UrlLauncher* url_launcher, |
64 const base::Closure& uninstall_closure) | 64 const base::Closure& uninstall_closure) |
(...skipping 30 matching lines...) Expand all Loading... |
95 WORD /*wID*/, | 95 WORD /*wID*/, |
96 HWND /*hWndCtl*/, | 96 HWND /*hWndCtl*/, |
97 BOOL& /*bHandled*/) { | 97 BOOL& /*bHandled*/) { |
98 frame_->CloseInfobar(); | 98 frame_->CloseInfobar(); |
99 if (!uninstall_closure_.is_null()) | 99 if (!uninstall_closure_.is_null()) |
100 uninstall_closure_.Run(); | 100 uninstall_closure_.Run(); |
101 return 0; | 101 return 0; |
102 } | 102 } |
103 | 103 |
104 // static | 104 // static |
105 string16 TurndownPromptWindow::GetPromptText() { | 105 base::string16 TurndownPromptWindow::GetPromptText() { |
106 IEVersion ie_version = GetIEVersion(); | 106 IEVersion ie_version = GetIEVersion(); |
107 int message_id = IDS_CHROME_FRAME_TURNDOWN_TEXT_IE_NEWER; | 107 int message_id = IDS_CHROME_FRAME_TURNDOWN_TEXT_IE_NEWER; |
108 if (ie_version == IE_6 || ie_version == IE_7 || ie_version == IE_8) | 108 if (ie_version == IE_6 || ie_version == IE_7 || ie_version == IE_8) |
109 message_id = IDS_CHROME_FRAME_TURNDOWN_TEXT_IE_OLDER; | 109 message_id = IDS_CHROME_FRAME_TURNDOWN_TEXT_IE_OLDER; |
110 return SimpleResourceLoader::GetInstance()->Get(message_id); | 110 return SimpleResourceLoader::GetInstance()->Get(message_id); |
111 } | 111 } |
OLD | NEW |