OLD | NEW |
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 Loading... |
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, UTF8ToUTF16(username_), | 319 message_text = ReplaceStringPlaceholders(message_text, |
| 320 base::UTF8ToUTF16(username_), |
320 NULL); | 321 NULL); |
321 if (message_text.length() > kMaxSharingWithTextLength) | 322 if (message_text.length() > kMaxSharingWithTextLength) |
322 message_text.erase(kMaxSharingWithTextLength); | 323 message_text.erase(kMaxSharingWithTextLength); |
323 | 324 |
324 if (!SetWindowText(hwnd_message, message_text.c_str())) | 325 if (!SetWindowText(hwnd_message, message_text.c_str())) |
325 return false; | 326 return false; |
326 | 327 |
327 // Calculate the margin between controls in pixels. | 328 // Calculate the margin between controls in pixels. |
328 RECT rect = {0}; | 329 RECT rect = {0}; |
329 rect.right = kWindowTextMargin; | 330 rect.right = kWindowTextMargin; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 } | 391 } |
391 | 392 |
392 } // namespace | 393 } // namespace |
393 | 394 |
394 // static | 395 // static |
395 scoped_ptr<HostWindow> HostWindow::CreateDisconnectWindow() { | 396 scoped_ptr<HostWindow> HostWindow::CreateDisconnectWindow() { |
396 return scoped_ptr<HostWindow>(new DisconnectWindowWin()); | 397 return scoped_ptr<HostWindow>(new DisconnectWindowWin()); |
397 } | 398 } |
398 | 399 |
399 } // namespace remoting | 400 } // namespace remoting |
OLD | NEW |