Index: ui/aura/remote_root_window_host_win.cc |
diff --git a/ui/aura/remote_root_window_host_win.cc b/ui/aura/remote_root_window_host_win.cc |
index 7b99866d5c9652a9623d48e0441fb899468dea72..3f096b1ebe8a242d88f5e38a2a2a2f0b7749ef7b 100644 |
--- a/ui/aura/remote_root_window_host_win.cc |
+++ b/ui/aura/remote_root_window_host_win.cc |
@@ -30,7 +30,7 @@ namespace aura { |
namespace { |
-const char* kRootWindowHostWinKey = "__AURA_REMOTE_ROOT_WINDOW_HOST_WIN__"; |
+const char* kWindowTreeHostWinKey = "__AURA_REMOTE_ROOT_WINDOW_HOST_WIN__"; |
// Sets the keystate for the virtual key passed in to down or up. |
void SetKeyState(uint8* key_states, bool key_down, uint32 virtual_key_code) { |
@@ -86,8 +86,8 @@ void HandleOpenFile(const base::string16& title, |
const base::string16& filter, |
const OpenFileCompletion& on_success, |
const FileSelectionCanceled& on_failure) { |
- DCHECK(aura::RemoteRootWindowHostWin::Instance()); |
- aura::RemoteRootWindowHostWin::Instance()->HandleOpenFile(title, |
+ DCHECK(aura::RemoteWindowTreeHostWin::Instance()); |
+ aura::RemoteWindowTreeHostWin::Instance()->HandleOpenFile(title, |
default_path, |
filter, |
on_success, |
@@ -99,8 +99,8 @@ void HandleOpenMultipleFiles(const base::string16& title, |
const base::string16& filter, |
const OpenMultipleFilesCompletion& on_success, |
const FileSelectionCanceled& on_failure) { |
- DCHECK(aura::RemoteRootWindowHostWin::Instance()); |
- aura::RemoteRootWindowHostWin::Instance()->HandleOpenMultipleFiles( |
+ DCHECK(aura::RemoteWindowTreeHostWin::Instance()); |
+ aura::RemoteWindowTreeHostWin::Instance()->HandleOpenMultipleFiles( |
title, |
default_path, |
filter, |
@@ -115,8 +115,8 @@ void HandleSaveFile(const base::string16& title, |
const base::string16& default_extension, |
const SaveFileCompletion& on_success, |
const FileSelectionCanceled& on_failure) { |
- DCHECK(aura::RemoteRootWindowHostWin::Instance()); |
- aura::RemoteRootWindowHostWin::Instance()->HandleSaveFile(title, |
+ DCHECK(aura::RemoteWindowTreeHostWin::Instance()); |
+ aura::RemoteWindowTreeHostWin::Instance()->HandleSaveFile(title, |
default_path, |
filter, |
filter_index, |
@@ -128,54 +128,54 @@ void HandleSaveFile(const base::string16& title, |
void HandleSelectFolder(const base::string16& title, |
const SelectFolderCompletion& on_success, |
const FileSelectionCanceled& on_failure) { |
- DCHECK(aura::RemoteRootWindowHostWin::Instance()); |
- aura::RemoteRootWindowHostWin::Instance()->HandleSelectFolder(title, |
+ DCHECK(aura::RemoteWindowTreeHostWin::Instance()); |
+ aura::RemoteWindowTreeHostWin::Instance()->HandleSelectFolder(title, |
on_success, |
on_failure); |
} |
void HandleActivateDesktop(const base::FilePath& shortcut, |
bool ash_exit) { |
- DCHECK(aura::RemoteRootWindowHostWin::Instance()); |
- aura::RemoteRootWindowHostWin::Instance()->HandleActivateDesktop(shortcut, |
+ DCHECK(aura::RemoteWindowTreeHostWin::Instance()); |
+ aura::RemoteWindowTreeHostWin::Instance()->HandleActivateDesktop(shortcut, |
ash_exit); |
} |
-RemoteRootWindowHostWin* g_instance = NULL; |
+RemoteWindowTreeHostWin* g_instance = NULL; |
-RemoteRootWindowHostWin* RemoteRootWindowHostWin::Instance() { |
+RemoteWindowTreeHostWin* RemoteWindowTreeHostWin::Instance() { |
if (g_instance) |
return g_instance; |
return Create(gfx::Rect()); |
} |
-RemoteRootWindowHostWin* RemoteRootWindowHostWin::Create( |
+RemoteWindowTreeHostWin* RemoteWindowTreeHostWin::Create( |
const gfx::Rect& bounds) { |
- g_instance = g_instance ? g_instance : new RemoteRootWindowHostWin(bounds); |
+ g_instance = g_instance ? g_instance : new RemoteWindowTreeHostWin(bounds); |
return g_instance; |
} |
-RemoteRootWindowHostWin::RemoteRootWindowHostWin(const gfx::Rect& bounds) |
+RemoteWindowTreeHostWin::RemoteWindowTreeHostWin(const gfx::Rect& bounds) |
: remote_window_(NULL), |
host_(NULL), |
ignore_mouse_moves_until_set_cursor_ack_(false), |
event_flags_(0), |
- window_size_(aura::RootWindowHost::GetNativeScreenSize()) { |
- prop_.reset(new ui::ViewProp(NULL, kRootWindowHostWinKey, this)); |
+ window_size_(aura::WindowTreeHost::GetNativeScreenSize()) { |
+ prop_.reset(new ui::ViewProp(NULL, kWindowTreeHostWinKey, this)); |
CreateCompositor(GetAcceleratedWidget()); |
} |
-RemoteRootWindowHostWin::~RemoteRootWindowHostWin() { |
+RemoteWindowTreeHostWin::~RemoteWindowTreeHostWin() { |
g_instance = NULL; |
} |
-void RemoteRootWindowHostWin::Connected(IPC::Sender* host, HWND remote_window) { |
+void RemoteWindowTreeHostWin::Connected(IPC::Sender* host, HWND remote_window) { |
CHECK(host_ == NULL); |
host_ = host; |
remote_window_ = remote_window; |
} |
-void RemoteRootWindowHostWin::Disconnected() { |
+void RemoteWindowTreeHostWin::Disconnected() { |
// Don't CHECK here, Disconnected is called on a channel error which can |
// happen before we're successfully Connected. |
if (!host_) |
@@ -188,9 +188,9 @@ void RemoteRootWindowHostWin::Disconnected() { |
remote_window_ = NULL; |
} |
-bool RemoteRootWindowHostWin::OnMessageReceived(const IPC::Message& message) { |
+bool RemoteWindowTreeHostWin::OnMessageReceived(const IPC::Message& message) { |
bool handled = true; |
- IPC_BEGIN_MESSAGE_MAP(RemoteRootWindowHostWin, message) |
+ IPC_BEGIN_MESSAGE_MAP(RemoteWindowTreeHostWin, message) |
IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MouseMoved, OnMouseMoved) |
IPC_MESSAGE_HANDLER(MetroViewerHostMsg_MouseButton, OnMouseButton) |
IPC_MESSAGE_HANDLER(MetroViewerHostMsg_KeyDown, OnKeyDown) |
@@ -227,7 +227,7 @@ bool RemoteRootWindowHostWin::OnMessageReceived(const IPC::Message& message) { |
return handled; |
} |
-void RemoteRootWindowHostWin::HandleOpenURLOnDesktop( |
+void RemoteWindowTreeHostWin::HandleOpenURLOnDesktop( |
const base::FilePath& shortcut, |
const base::string16& url) { |
if (!host_) |
@@ -235,7 +235,7 @@ void RemoteRootWindowHostWin::HandleOpenURLOnDesktop( |
host_->Send(new MetroViewerHostMsg_OpenURLOnDesktop(shortcut, url)); |
} |
-void RemoteRootWindowHostWin::HandleActivateDesktop( |
+void RemoteWindowTreeHostWin::HandleActivateDesktop( |
const base::FilePath& shortcut, |
bool ash_exit) { |
if (!host_) |
@@ -243,7 +243,7 @@ void RemoteRootWindowHostWin::HandleActivateDesktop( |
host_->Send(new MetroViewerHostMsg_ActivateDesktop(shortcut, ash_exit)); |
} |
-void RemoteRootWindowHostWin::HandleOpenFile( |
+void RemoteWindowTreeHostWin::HandleOpenFile( |
const base::string16& title, |
const base::FilePath& default_path, |
const base::string16& filter, |
@@ -265,7 +265,7 @@ void RemoteRootWindowHostWin::HandleOpenFile( |
false)); |
} |
-void RemoteRootWindowHostWin::HandleOpenMultipleFiles( |
+void RemoteWindowTreeHostWin::HandleOpenMultipleFiles( |
const base::string16& title, |
const base::FilePath& default_path, |
const base::string16& filter, |
@@ -286,7 +286,7 @@ void RemoteRootWindowHostWin::HandleOpenMultipleFiles( |
true)); |
} |
-void RemoteRootWindowHostWin::HandleSaveFile( |
+void RemoteWindowTreeHostWin::HandleSaveFile( |
const base::string16& title, |
const base::FilePath& default_path, |
const base::string16& filter, |
@@ -313,7 +313,7 @@ void RemoteRootWindowHostWin::HandleSaveFile( |
host_->Send(new MetroViewerHostMsg_DisplayFileSaveAs(params)); |
} |
-void RemoteRootWindowHostWin::HandleSelectFolder( |
+void RemoteWindowTreeHostWin::HandleSelectFolder( |
const base::string16& title, |
const SelectFolderCompletion& on_success, |
const FileSelectionCanceled& on_failure) { |
@@ -329,78 +329,78 @@ void RemoteRootWindowHostWin::HandleSelectFolder( |
host_->Send(new MetroViewerHostMsg_DisplaySelectFolder(title)); |
} |
-void RemoteRootWindowHostWin::HandleWindowSizeChanged(uint32 width, |
+void RemoteWindowTreeHostWin::HandleWindowSizeChanged(uint32 width, |
uint32 height) { |
SetBounds(gfx::Rect(0, 0, width, height)); |
} |
-bool RemoteRootWindowHostWin::IsForegroundWindow() { |
+bool RemoteWindowTreeHostWin::IsForegroundWindow() { |
return ::GetForegroundWindow() == remote_window_; |
} |
-Window* RemoteRootWindowHostWin::GetAshWindow() { |
+Window* RemoteWindowTreeHostWin::GetAshWindow() { |
return GetRootWindow()->window(); |
} |
-RootWindow* RemoteRootWindowHostWin::GetRootWindow() { |
+RootWindow* RemoteWindowTreeHostWin::GetRootWindow() { |
return delegate_->AsRootWindow(); |
} |
-gfx::AcceleratedWidget RemoteRootWindowHostWin::GetAcceleratedWidget() { |
+gfx::AcceleratedWidget RemoteWindowTreeHostWin::GetAcceleratedWidget() { |
if (remote_window_) |
return remote_window_; |
// Getting here should only happen for ash_unittests.exe and related code. |
return ::GetDesktopWindow(); |
} |
-void RemoteRootWindowHostWin::Show() { |
+void RemoteWindowTreeHostWin::Show() { |
ui::RemoteInputMethodPrivateWin* remote_input_method_private = |
GetRemoteInputMethodPrivate(); |
if (remote_input_method_private) |
remote_input_method_private->SetRemoteDelegate(this); |
} |
-void RemoteRootWindowHostWin::Hide() { |
+void RemoteWindowTreeHostWin::Hide() { |
NOTIMPLEMENTED(); |
} |
-void RemoteRootWindowHostWin::ToggleFullScreen() { |
+void RemoteWindowTreeHostWin::ToggleFullScreen() { |
} |
-gfx::Rect RemoteRootWindowHostWin::GetBounds() const { |
+gfx::Rect RemoteWindowTreeHostWin::GetBounds() const { |
return gfx::Rect(window_size_); |
} |
-void RemoteRootWindowHostWin::SetBounds(const gfx::Rect& bounds) { |
+void RemoteWindowTreeHostWin::SetBounds(const gfx::Rect& bounds) { |
window_size_ = bounds.size(); |
NotifyHostResized(bounds.size()); |
} |
-gfx::Insets RemoteRootWindowHostWin::GetInsets() const { |
+gfx::Insets RemoteWindowTreeHostWin::GetInsets() const { |
return gfx::Insets(); |
} |
-void RemoteRootWindowHostWin::SetInsets(const gfx::Insets& insets) { |
+void RemoteWindowTreeHostWin::SetInsets(const gfx::Insets& insets) { |
} |
-gfx::Point RemoteRootWindowHostWin::GetLocationOnNativeScreen() const { |
+gfx::Point RemoteWindowTreeHostWin::GetLocationOnNativeScreen() const { |
return gfx::Point(0, 0); |
} |
-void RemoteRootWindowHostWin::SetCursor(gfx::NativeCursor native_cursor) { |
+void RemoteWindowTreeHostWin::SetCursor(gfx::NativeCursor native_cursor) { |
if (!host_) |
return; |
host_->Send( |
new MetroViewerHostMsg_SetCursor(uint64(native_cursor.platform()))); |
} |
-void RemoteRootWindowHostWin::SetCapture() { |
+void RemoteWindowTreeHostWin::SetCapture() { |
} |
-void RemoteRootWindowHostWin::ReleaseCapture() { |
+void RemoteWindowTreeHostWin::ReleaseCapture() { |
} |
-bool RemoteRootWindowHostWin::QueryMouseLocation(gfx::Point* location_return) { |
+bool RemoteWindowTreeHostWin::QueryMouseLocation(gfx::Point* location_return) { |
aura::client::CursorClient* cursor_client = |
aura::client::GetCursorClient(GetRootWindow()->window()); |
if (cursor_client && !cursor_client->IsMouseEventsEnabled()) { |
@@ -414,18 +414,18 @@ bool RemoteRootWindowHostWin::QueryMouseLocation(gfx::Point* location_return) { |
return true; |
} |
-bool RemoteRootWindowHostWin::ConfineCursorToRootWindow() { |
+bool RemoteWindowTreeHostWin::ConfineCursorToRootWindow() { |
return true; |
} |
-void RemoteRootWindowHostWin::UnConfineCursor() { |
+void RemoteWindowTreeHostWin::UnConfineCursor() { |
} |
-void RemoteRootWindowHostWin::OnCursorVisibilityChanged(bool show) { |
+void RemoteWindowTreeHostWin::OnCursorVisibilityChanged(bool show) { |
NOTIMPLEMENTED(); |
} |
-void RemoteRootWindowHostWin::MoveCursorTo(const gfx::Point& location) { |
+void RemoteWindowTreeHostWin::MoveCursorTo(const gfx::Point& location) { |
VLOG(1) << "In MoveCursorTo: " << location.x() << ", " << location.y(); |
if (!host_) |
return; |
@@ -450,23 +450,23 @@ void RemoteRootWindowHostWin::MoveCursorTo(const gfx::Point& location) { |
host_->Send(new MetroViewerHostMsg_SetCursorPos(location.x(), location.y())); |
} |
-void RemoteRootWindowHostWin::PostNativeEvent( |
+void RemoteWindowTreeHostWin::PostNativeEvent( |
const base::NativeEvent& native_event) { |
} |
-void RemoteRootWindowHostWin::OnDeviceScaleFactorChanged( |
+void RemoteWindowTreeHostWin::OnDeviceScaleFactorChanged( |
float device_scale_factor) { |
NOTIMPLEMENTED(); |
} |
-void RemoteRootWindowHostWin::PrepareForShutdown() { |
+void RemoteWindowTreeHostWin::PrepareForShutdown() { |
} |
-void RemoteRootWindowHostWin::CancelComposition() { |
+void RemoteWindowTreeHostWin::CancelComposition() { |
host_->Send(new MetroViewerHostMsg_ImeCancelComposition); |
} |
-void RemoteRootWindowHostWin::OnTextInputClientUpdated( |
+void RemoteWindowTreeHostWin::OnTextInputClientUpdated( |
const std::vector<int32>& input_scopes, |
const std::vector<gfx::Rect>& composition_character_bounds) { |
std::vector<metro_viewer::CharacterBounds> character_bounds; |
@@ -483,7 +483,7 @@ void RemoteRootWindowHostWin::OnTextInputClientUpdated( |
input_scopes, character_bounds)); |
} |
-void RemoteRootWindowHostWin::OnMouseMoved(int32 x, int32 y, int32 flags) { |
+void RemoteWindowTreeHostWin::OnMouseMoved(int32 x, int32 y, int32 flags) { |
if (ignore_mouse_moves_until_set_cursor_ack_) |
return; |
@@ -492,7 +492,7 @@ void RemoteRootWindowHostWin::OnMouseMoved(int32 x, int32 y, int32 flags) { |
delegate_->OnHostMouseEvent(&event); |
} |
-void RemoteRootWindowHostWin::OnMouseButton( |
+void RemoteWindowTreeHostWin::OnMouseButton( |
const MetroViewerHostMsg_MouseButtonParams& params) { |
gfx::Point location(params.x, params.y); |
ui::MouseEvent mouse_event(params.event_type, location, location, |
@@ -524,7 +524,7 @@ void RemoteRootWindowHostWin::OnMouseButton( |
} |
} |
-void RemoteRootWindowHostWin::OnKeyDown(uint32 vkey, |
+void RemoteWindowTreeHostWin::OnKeyDown(uint32 vkey, |
uint32 repeat_count, |
uint32 scan_code, |
uint32 flags) { |
@@ -532,7 +532,7 @@ void RemoteRootWindowHostWin::OnKeyDown(uint32 vkey, |
flags, false); |
} |
-void RemoteRootWindowHostWin::OnKeyUp(uint32 vkey, |
+void RemoteWindowTreeHostWin::OnKeyUp(uint32 vkey, |
uint32 repeat_count, |
uint32 scan_code, |
uint32 flags) { |
@@ -540,7 +540,7 @@ void RemoteRootWindowHostWin::OnKeyUp(uint32 vkey, |
flags, false); |
} |
-void RemoteRootWindowHostWin::OnChar(uint32 key_code, |
+void RemoteWindowTreeHostWin::OnChar(uint32 key_code, |
uint32 repeat_count, |
uint32 scan_code, |
uint32 flags) { |
@@ -548,11 +548,11 @@ void RemoteRootWindowHostWin::OnChar(uint32 key_code, |
scan_code, flags, true); |
} |
-void RemoteRootWindowHostWin::OnWindowActivated() { |
+void RemoteWindowTreeHostWin::OnWindowActivated() { |
delegate_->OnHostActivated(); |
} |
-void RemoteRootWindowHostWin::OnTouchDown(int32 x, |
+void RemoteWindowTreeHostWin::OnTouchDown(int32 x, |
int32 y, |
uint64 timestamp, |
uint32 pointer_id) { |
@@ -563,7 +563,7 @@ void RemoteRootWindowHostWin::OnTouchDown(int32 x, |
delegate_->OnHostTouchEvent(&event); |
} |
-void RemoteRootWindowHostWin::OnTouchUp(int32 x, |
+void RemoteWindowTreeHostWin::OnTouchUp(int32 x, |
int32 y, |
uint64 timestamp, |
uint32 pointer_id) { |
@@ -574,7 +574,7 @@ void RemoteRootWindowHostWin::OnTouchUp(int32 x, |
delegate_->OnHostTouchEvent(&event); |
} |
-void RemoteRootWindowHostWin::OnTouchMoved(int32 x, |
+void RemoteWindowTreeHostWin::OnTouchMoved(int32 x, |
int32 y, |
uint64 timestamp, |
uint32 pointer_id) { |
@@ -585,7 +585,7 @@ void RemoteRootWindowHostWin::OnTouchMoved(int32 x, |
delegate_->OnHostTouchEvent(&event); |
} |
-void RemoteRootWindowHostWin::OnFileSaveAsDone(bool success, |
+void RemoteWindowTreeHostWin::OnFileSaveAsDone(bool success, |
const base::FilePath& filename, |
int filter_index) { |
if (success) |
@@ -597,7 +597,7 @@ void RemoteRootWindowHostWin::OnFileSaveAsDone(bool success, |
} |
-void RemoteRootWindowHostWin::OnFileOpenDone(bool success, |
+void RemoteWindowTreeHostWin::OnFileOpenDone(bool success, |
const base::FilePath& filename) { |
if (success) |
file_open_completion_callback_.Run(base::FilePath(filename), 0, NULL); |
@@ -607,7 +607,7 @@ void RemoteRootWindowHostWin::OnFileOpenDone(bool success, |
failure_callback_.Reset(); |
} |
-void RemoteRootWindowHostWin::OnMultiFileOpenDone( |
+void RemoteWindowTreeHostWin::OnMultiFileOpenDone( |
bool success, |
const std::vector<base::FilePath>& files) { |
if (success) |
@@ -618,7 +618,7 @@ void RemoteRootWindowHostWin::OnMultiFileOpenDone( |
failure_callback_.Reset(); |
} |
-void RemoteRootWindowHostWin::OnSelectFolderDone( |
+void RemoteWindowTreeHostWin::OnSelectFolderDone( |
bool success, |
const base::FilePath& folder) { |
if (success) |
@@ -629,19 +629,19 @@ void RemoteRootWindowHostWin::OnSelectFolderDone( |
failure_callback_.Reset(); |
} |
-void RemoteRootWindowHostWin::OnSetCursorPosAck() { |
+void RemoteWindowTreeHostWin::OnSetCursorPosAck() { |
DCHECK(ignore_mouse_moves_until_set_cursor_ack_); |
ignore_mouse_moves_until_set_cursor_ack_ = false; |
} |
ui::RemoteInputMethodPrivateWin* |
-RemoteRootWindowHostWin::GetRemoteInputMethodPrivate() { |
+RemoteWindowTreeHostWin::GetRemoteInputMethodPrivate() { |
ui::InputMethod* input_method = GetAshWindow()->GetProperty( |
aura::client::kRootWindowInputMethodKey); |
return ui::RemoteInputMethodPrivateWin::Get(input_method); |
} |
-void RemoteRootWindowHostWin::OnImeCandidatePopupChanged(bool visible) { |
+void RemoteWindowTreeHostWin::OnImeCandidatePopupChanged(bool visible) { |
ui::RemoteInputMethodPrivateWin* remote_input_method_private = |
GetRemoteInputMethodPrivate(); |
if (!remote_input_method_private) |
@@ -649,7 +649,7 @@ void RemoteRootWindowHostWin::OnImeCandidatePopupChanged(bool visible) { |
remote_input_method_private->OnCandidatePopupChanged(visible); |
} |
-void RemoteRootWindowHostWin::OnImeCompositionChanged( |
+void RemoteWindowTreeHostWin::OnImeCompositionChanged( |
const base::string16& text, |
int32 selection_start, |
int32 selection_end, |
@@ -664,7 +664,7 @@ void RemoteRootWindowHostWin::OnImeCompositionChanged( |
remote_input_method_private->OnCompositionChanged(composition_text); |
} |
-void RemoteRootWindowHostWin::OnImeTextCommitted(const base::string16& text) { |
+void RemoteWindowTreeHostWin::OnImeTextCommitted(const base::string16& text) { |
ui::RemoteInputMethodPrivateWin* remote_input_method_private = |
GetRemoteInputMethodPrivate(); |
if (!remote_input_method_private) |
@@ -672,7 +672,7 @@ void RemoteRootWindowHostWin::OnImeTextCommitted(const base::string16& text) { |
remote_input_method_private->OnTextCommitted(text); |
} |
-void RemoteRootWindowHostWin::OnImeInputSourceChanged(uint16 language_id, |
+void RemoteWindowTreeHostWin::OnImeInputSourceChanged(uint16 language_id, |
bool is_ime) { |
ui::RemoteInputMethodPrivateWin* remote_input_method_private = |
GetRemoteInputMethodPrivate(); |
@@ -681,7 +681,7 @@ void RemoteRootWindowHostWin::OnImeInputSourceChanged(uint16 language_id, |
remote_input_method_private->OnInputSourceChanged(language_id, is_ime); |
} |
-void RemoteRootWindowHostWin::DispatchKeyboardMessage(ui::EventType type, |
+void RemoteWindowTreeHostWin::DispatchKeyboardMessage(ui::EventType type, |
uint32 vkey, |
uint32 repeat_count, |
uint32 scan_code, |
@@ -710,7 +710,7 @@ void RemoteRootWindowHostWin::DispatchKeyboardMessage(ui::EventType type, |
} |
} |
-void RemoteRootWindowHostWin::SetEventFlags(uint32 flags) { |
+void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { |
if (flags == event_flags_) |
return; |
event_flags_ = flags; |