Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: chrome/browser/ui/views/external_protocol_dialog.cc

Issue 10378086: views: Add a new ctor to MessageBoxView that takes only a InitParams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix review Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
140 IDS_EXTERNAL_PROTOCOL_INFORMATION, 140 IDS_EXTERNAL_PROTOCOL_INFORMATION,
141 ASCIIToUTF16(url.scheme() + ":"), 141 ASCIIToUTF16(url.scheme() + ":"),
142 elided_url_without_scheme) + ASCIIToUTF16("\n\n"); 142 elided_url_without_scheme) + ASCIIToUTF16("\n\n");
143 143
144 message_text += l10n_util::GetStringFUTF16( 144 message_text += l10n_util::GetStringFUTF16(
145 IDS_EXTERNAL_PROTOCOL_APPLICATION_TO_LAUNCH, 145 IDS_EXTERNAL_PROTOCOL_APPLICATION_TO_LAUNCH,
146 elided_command) + ASCIIToUTF16("\n\n"); 146 elided_command) + ASCIIToUTF16("\n\n");
147 147
148 message_text += l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_WARNING); 148 message_text += l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_WARNING);
149 149
150 message_box_view_ = new views::MessageBoxView( 150 views::MessageBoxView::InitParams params(message_text);
151 views::MessageBoxView::NO_OPTIONS, 151 params.message_width = kMessageWidth;
152 message_text, 152 message_box_view_ = new views::MessageBoxView(params);
153 string16(),
154 kMessageWidth);
155 message_box_view_->SetCheckBoxLabel( 153 message_box_view_->SetCheckBoxLabel(
156 l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT)); 154 l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT));
157 155
158 HWND root_hwnd; 156 HWND root_hwnd;
159 if (web_contents_) { 157 if (web_contents_) {
160 root_hwnd = GetAncestor(web_contents_->GetContentNativeView(), GA_ROOT); 158 root_hwnd = GetAncestor(web_contents_->GetContentNativeView(), GA_ROOT);
161 } else { 159 } else {
162 // Dialog is top level if we don't have a tab_contents associated with us. 160 // Dialog is top level if we don't have a tab_contents associated with us.
163 root_hwnd = NULL; 161 root_hwnd = NULL;
164 } 162 }
(...skipping 18 matching lines...) Expand all
183 std::wstring parameters = url_spec.substr(split_offset + 1, 181 std::wstring parameters = url_spec.substr(split_offset + 1,
184 url_spec.length() - 1); 182 url_spec.length() - 1);
185 std::wstring application_to_launch; 183 std::wstring application_to_launch;
186 if (cmd_key.ReadValue(NULL, &application_to_launch) == ERROR_SUCCESS) { 184 if (cmd_key.ReadValue(NULL, &application_to_launch) == ERROR_SUCCESS) {
187 ReplaceSubstringsAfterOffset(&application_to_launch, 0, L"%1", parameters); 185 ReplaceSubstringsAfterOffset(&application_to_launch, 0, L"%1", parameters);
188 return application_to_launch; 186 return application_to_launch;
189 } else { 187 } else {
190 return std::wstring(); 188 return std::wstring();
191 } 189 }
192 } 190 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/download/download_in_progress_dialog_view.cc ('k') | chrome/browser/ui/views/js_modal_dialog_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698