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_util.h" | 9 #include "base/process_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 return false; | 224 return false; |
225 | 225 |
226 DLGTEMPLATE* dialog_pointer = | 226 DLGTEMPLATE* dialog_pointer = |
227 reinterpret_cast<DLGTEMPLATE*>(LockResource(dialog_template)); | 227 reinterpret_cast<DLGTEMPLATE*>(LockResource(dialog_template)); |
228 if (!dialog_pointer) | 228 if (!dialog_pointer) |
229 return false; | 229 return false; |
230 | 230 |
231 // The actual resource type is DLGTEMPLATEEX, but this is not defined in any | 231 // The actual resource type is DLGTEMPLATEEX, but this is not defined in any |
232 // standard headers, so we treat it as a generic pointer and manipulate the | 232 // standard headers, so we treat it as a generic pointer and manipulate the |
233 // correct offsets explicitly. | 233 // correct offsets explicitly. |
234 scoped_array<unsigned char> rtl_dialog_template; | 234 scoped_ptr<unsigned char[]> rtl_dialog_template; |
235 if (ui_strings_.direction == UiStrings::RTL) { | 235 if (ui_strings_.direction == UiStrings::RTL) { |
236 unsigned long dialog_template_size = | 236 unsigned long dialog_template_size = |
237 SizeofResource(module, dialog_resource); | 237 SizeofResource(module, dialog_resource); |
238 rtl_dialog_template.reset(new unsigned char[dialog_template_size]); | 238 rtl_dialog_template.reset(new unsigned char[dialog_template_size]); |
239 memcpy(rtl_dialog_template.get(), dialog_pointer, dialog_template_size); | 239 memcpy(rtl_dialog_template.get(), dialog_pointer, dialog_template_size); |
240 DWORD* rtl_dwords = reinterpret_cast<DWORD*>(rtl_dialog_template.get()); | 240 DWORD* rtl_dwords = reinterpret_cast<DWORD*>(rtl_dialog_template.get()); |
241 rtl_dwords[2] |= (WS_EX_LAYOUTRTL | WS_EX_RTLREADING); | 241 rtl_dwords[2] |= (WS_EX_LAYOUTRTL | WS_EX_RTLREADING); |
242 dialog_pointer = reinterpret_cast<DLGTEMPLATE*>(rtl_dwords); | 242 dialog_pointer = reinterpret_cast<DLGTEMPLATE*>(rtl_dwords); |
243 } | 243 } |
244 | 244 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 } // namespace | 391 } // namespace |
392 | 392 |
393 // static | 393 // static |
394 scoped_ptr<HostWindow> HostWindow::CreateDisconnectWindow( | 394 scoped_ptr<HostWindow> HostWindow::CreateDisconnectWindow( |
395 const UiStrings& ui_strings) { | 395 const UiStrings& ui_strings) { |
396 return scoped_ptr<HostWindow>(new DisconnectWindowWin(ui_strings)); | 396 return scoped_ptr<HostWindow>(new DisconnectWindowWin(ui_strings)); |
397 } | 397 } |
398 | 398 |
399 } // namespace remoting | 399 } // namespace remoting |
OLD | NEW |