| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 elided_command) + ASCIIToUTF16("\n\n")); | 147 elided_command) + ASCIIToUTF16("\n\n")); |
| 148 | 148 |
| 149 message_text += | 149 message_text += |
| 150 UTF16ToWide(l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_WARNING)); | 150 UTF16ToWide(l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_WARNING)); |
| 151 | 151 |
| 152 message_box_view_ = new views::MessageBoxView( | 152 message_box_view_ = new views::MessageBoxView( |
| 153 ui::MessageBoxFlags::kIsConfirmMessageBox, | 153 ui::MessageBoxFlags::kIsConfirmMessageBox, |
| 154 message_text, | 154 message_text, |
| 155 std::wstring(), | 155 std::wstring(), |
| 156 kMessageWidth); | 156 kMessageWidth); |
| 157 message_box_view_->SetCheckBoxLabel( | 157 message_box_view_->SetCheckBoxLabel(UTF16ToWide( |
| 158 l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT)); | 158 l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT))); |
| 159 | 159 |
| 160 HWND root_hwnd; | 160 HWND root_hwnd; |
| 161 if (tab_contents_) { | 161 if (tab_contents_) { |
| 162 root_hwnd = GetAncestor(tab_contents_->GetContentNativeView(), GA_ROOT); | 162 root_hwnd = GetAncestor(tab_contents_->GetContentNativeView(), GA_ROOT); |
| 163 } else { | 163 } else { |
| 164 // Dialog is top level if we don't have a tab_contents associated with us. | 164 // Dialog is top level if we don't have a tab_contents associated with us. |
| 165 root_hwnd = NULL; | 165 root_hwnd = NULL; |
| 166 } | 166 } |
| 167 | 167 |
| 168 views::Widget::CreateWindowWithParent(this, root_hwnd)->Show(); | 168 views::Widget::CreateWindowWithParent(this, root_hwnd)->Show(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 185 std::wstring parameters = url_spec.substr(split_offset + 1, | 185 std::wstring parameters = url_spec.substr(split_offset + 1, |
| 186 url_spec.length() - 1); | 186 url_spec.length() - 1); |
| 187 std::wstring application_to_launch; | 187 std::wstring application_to_launch; |
| 188 if (cmd_key.ReadValue(NULL, &application_to_launch) == ERROR_SUCCESS) { | 188 if (cmd_key.ReadValue(NULL, &application_to_launch) == ERROR_SUCCESS) { |
| 189 ReplaceSubstringsAfterOffset(&application_to_launch, 0, L"%1", parameters); | 189 ReplaceSubstringsAfterOffset(&application_to_launch, 0, L"%1", parameters); |
| 190 return application_to_launch; | 190 return application_to_launch; |
| 191 } else { | 191 } else { |
| 192 return std::wstring(); | 192 return std::wstring(); |
| 193 } | 193 } |
| 194 } | 194 } |
| OLD | NEW |