OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/ui/views/external_protocol_dialog.h" | 5 #include "chrome/browser/ui/views/external_protocol_dialog.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 ASCIIToUTF16(url.scheme() + ":"), | 140 ASCIIToUTF16(url.scheme() + ":"), |
141 elided_url_without_scheme) + ASCIIToUTF16("\n\n"); | 141 elided_url_without_scheme) + ASCIIToUTF16("\n\n"); |
142 | 142 |
143 message_text += l10n_util::GetStringFUTF16( | 143 message_text += l10n_util::GetStringFUTF16( |
144 IDS_EXTERNAL_PROTOCOL_APPLICATION_TO_LAUNCH, | 144 IDS_EXTERNAL_PROTOCOL_APPLICATION_TO_LAUNCH, |
145 elided_command) + ASCIIToUTF16("\n\n"); | 145 elided_command) + ASCIIToUTF16("\n\n"); |
146 | 146 |
147 message_text += l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_WARNING); | 147 message_text += l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_WARNING); |
148 | 148 |
149 message_box_view_ = new views::MessageBoxView( | 149 message_box_view_ = new views::MessageBoxView( |
150 ui::MessageBoxFlags::kIsConfirmMessageBox, | 150 ui::MESSAGE_BOX_IS_CONFIRM_DIALOG, |
tfarina
2011/11/12 12:40:22
same comment about kIsConfirmMessageBox from repos
| |
151 message_text, | 151 message_text, |
152 string16(), | 152 string16(), |
153 kMessageWidth); | 153 kMessageWidth); |
154 message_box_view_->SetCheckBoxLabel( | 154 message_box_view_->SetCheckBoxLabel( |
155 l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT)); | 155 l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT)); |
156 | 156 |
157 HWND root_hwnd; | 157 HWND root_hwnd; |
158 if (tab_contents_) { | 158 if (tab_contents_) { |
159 root_hwnd = GetAncestor(tab_contents_->GetContentNativeView(), GA_ROOT); | 159 root_hwnd = GetAncestor(tab_contents_->GetContentNativeView(), GA_ROOT); |
160 } else { | 160 } else { |
(...skipping 21 matching lines...) Expand all Loading... | |
182 std::wstring parameters = url_spec.substr(split_offset + 1, | 182 std::wstring parameters = url_spec.substr(split_offset + 1, |
183 url_spec.length() - 1); | 183 url_spec.length() - 1); |
184 std::wstring application_to_launch; | 184 std::wstring application_to_launch; |
185 if (cmd_key.ReadValue(NULL, &application_to_launch) == ERROR_SUCCESS) { | 185 if (cmd_key.ReadValue(NULL, &application_to_launch) == ERROR_SUCCESS) { |
186 ReplaceSubstringsAfterOffset(&application_to_launch, 0, L"%1", parameters); | 186 ReplaceSubstringsAfterOffset(&application_to_launch, 0, L"%1", parameters); |
187 return application_to_launch; | 187 return application_to_launch; |
188 } else { | 188 } else { |
189 return std::wstring(); | 189 return std::wstring(); |
190 } | 190 } |
191 } | 191 } |
OLD | NEW |