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: remoting/host/disconnect_window_win.cc

Issue 1227413007: Move ReplaceStringPlaceholders to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@join
Patch Set: Created 5 years, 5 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
« no previous file with comments | « ios/web/webui/shared_resources_data_source_ios.cc ('k') | ui/base/l10n/l10n_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <windows.h> 5 #include <windows.h>
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/process/memory.h" 9 #include "base/process/memory.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 return false; 309 return false;
310 310
311 base::string16 button_text; 311 base::string16 button_text;
312 base::string16 message_text; 312 base::string16 message_text;
313 if (!GetControlText(hwnd_button, &button_text) || 313 if (!GetControlText(hwnd_button, &button_text) ||
314 !GetControlText(hwnd_message, &message_text)) { 314 !GetControlText(hwnd_message, &message_text)) {
315 return false; 315 return false;
316 } 316 }
317 317
318 // Format and truncate "Your desktop is shared with ..." message. 318 // Format and truncate "Your desktop is shared with ..." message.
319 message_text = ReplaceStringPlaceholders(message_text, 319 message_text = base::ReplaceStringPlaceholders(message_text,
320 base::UTF8ToUTF16(username_), 320 base::UTF8ToUTF16(username_),
321 nullptr); 321 nullptr);
322 if (message_text.length() > kMaxSharingWithTextLength) 322 if (message_text.length() > kMaxSharingWithTextLength)
323 message_text.erase(kMaxSharingWithTextLength); 323 message_text.erase(kMaxSharingWithTextLength);
324 324
325 if (!SetWindowText(hwnd_message, message_text.c_str())) 325 if (!SetWindowText(hwnd_message, message_text.c_str()))
326 return false; 326 return false;
327 327
328 // Calculate the margin between controls in pixels. 328 // Calculate the margin between controls in pixels.
329 RECT rect = {0}; 329 RECT rect = {0};
330 rect.right = kWindowTextMargin; 330 rect.right = kWindowTextMargin;
331 if (!MapDialogRect(hwnd_, &rect)) 331 if (!MapDialogRect(hwnd_, &rect))
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 } 391 }
392 392
393 } // namespace 393 } // namespace
394 394
395 // static 395 // static
396 scoped_ptr<HostWindow> HostWindow::CreateDisconnectWindow() { 396 scoped_ptr<HostWindow> HostWindow::CreateDisconnectWindow() {
397 return make_scoped_ptr(new DisconnectWindowWin()); 397 return make_scoped_ptr(new DisconnectWindowWin());
398 } 398 }
399 399
400 } // namespace remoting 400 } // namespace remoting
OLDNEW
« no previous file with comments | « ios/web/webui/shared_resources_data_source_ios.cc ('k') | ui/base/l10n/l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698