OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/base/ime/remote_input_method_win.h" | 5 #include "ui/base/ime/remote_input_method_win.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "base/win/metro.h" | |
15 #include "base/win/scoped_handle.h" | 14 #include "base/win/scoped_handle.h" |
16 #include "ui/base/ime/input_method.h" | 15 #include "ui/base/ime/input_method.h" |
17 #include "ui/base/ime/input_method_delegate.h" | 16 #include "ui/base/ime/input_method_delegate.h" |
18 #include "ui/base/ime/input_method_observer.h" | 17 #include "ui/base/ime/input_method_observer.h" |
19 #include "ui/base/ime/remote_input_method_delegate_win.h" | 18 #include "ui/base/ime/remote_input_method_delegate_win.h" |
20 #include "ui/base/ime/text_input_client.h" | 19 #include "ui/base/ime/text_input_client.h" |
21 #include "ui/base/ime/win/tsf_input_scope.h" | 20 #include "ui/base/ime/win/tsf_input_scope.h" |
22 #include "ui/base/ui_base_switches.h" | 21 #include "ui/base/ui_base_switches.h" |
23 #include "ui/events/event.h" | 22 #include "ui/events/event.h" |
24 #include "ui/events/event_utils.h" | 23 #include "ui/events/event_utils.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 if (ui::g_public_interface_ && ui::g_private_interface_) | 358 if (ui::g_public_interface_ && ui::g_private_interface_) |
360 return false; | 359 return false; |
361 | 360 |
362 DWORD process_id = 0; | 361 DWORD process_id = 0; |
363 if (GetWindowThreadProcessId(widget, &process_id) == 0) | 362 if (GetWindowThreadProcessId(widget, &process_id) == 0) |
364 return false; | 363 return false; |
365 base::win::ScopedHandle process_handle(::OpenProcess( | 364 base::win::ScopedHandle process_handle(::OpenProcess( |
366 PROCESS_QUERY_LIMITED_INFORMATION, FALSE, process_id)); | 365 PROCESS_QUERY_LIMITED_INFORMATION, FALSE, process_id)); |
367 if (!process_handle.IsValid()) | 366 if (!process_handle.IsValid()) |
368 return false; | 367 return false; |
369 return base::win::IsProcessImmersive(process_handle.Get()) || | 368 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
370 base::CommandLine::ForCurrentProcess()->HasSwitch( | 369 switches::kViewerConnect); |
371 switches::kViewerConnect); | |
372 } | 370 } |
373 | 371 |
374 RemoteInputMethodPrivateWin::RemoteInputMethodPrivateWin() {} | 372 RemoteInputMethodPrivateWin::RemoteInputMethodPrivateWin() {} |
375 | 373 |
376 scoped_ptr<InputMethod> CreateRemoteInputMethodWin( | 374 scoped_ptr<InputMethod> CreateRemoteInputMethodWin( |
377 internal::InputMethodDelegate* delegate) { | 375 internal::InputMethodDelegate* delegate) { |
378 return make_scoped_ptr(new RemoteInputMethodWin(delegate)); | 376 return make_scoped_ptr(new RemoteInputMethodWin(delegate)); |
379 } | 377 } |
380 | 378 |
381 // static | 379 // static |
382 RemoteInputMethodPrivateWin* RemoteInputMethodPrivateWin::Get( | 380 RemoteInputMethodPrivateWin* RemoteInputMethodPrivateWin::Get( |
383 InputMethod* input_method) { | 381 InputMethod* input_method) { |
384 return GetPrivate(input_method); | 382 return GetPrivate(input_method); |
385 } | 383 } |
386 | 384 |
387 } // namespace ui | 385 } // namespace ui |
OLD | NEW |