Index: ui/aura/window_tree_host_win.cc |
diff --git a/ui/aura/window_tree_host_win.cc b/ui/aura/window_tree_host_win.cc |
deleted file mode 100644 |
index ea7bf24e262c6746f792d9def664b00e7ba7dc46..0000000000000000000000000000000000000000 |
--- a/ui/aura/window_tree_host_win.cc |
+++ /dev/null |
@@ -1,155 +0,0 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
-// Use of this source code is governed by a BSD-style license that can be |
-// found in the LICENSE file. |
- |
-#include "ui/aura/window_tree_host_win.h" |
- |
-#include <windows.h> |
- |
-#include <algorithm> |
- |
-#include "base/message_loop/message_loop.h" |
-#include "ui/aura/client/cursor_client.h" |
-#include "ui/aura/window_event_dispatcher.h" |
-#include "ui/base/cursor/cursor_loader_win.h" |
-#include "ui/base/view_prop.h" |
-#include "ui/compositor/compositor.h" |
-#include "ui/events/event.h" |
-#include "ui/gfx/display.h" |
-#include "ui/gfx/geometry/insets.h" |
-#include "ui/gfx/native_widget_types.h" |
-#include "ui/gfx/screen.h" |
-#include "ui/platform_window/win/win_window.h" |
- |
-using std::max; |
-using std::min; |
- |
-namespace aura { |
- |
-// static |
-WindowTreeHost* WindowTreeHost::Create(const gfx::Rect& bounds) { |
- return new WindowTreeHostWin(bounds); |
-} |
- |
-WindowTreeHostWin::WindowTreeHostWin(const gfx::Rect& bounds) |
- : has_capture_(false), |
- widget_(gfx::kNullAcceleratedWidget), |
- window_(new ui::WinWindow(this, bounds)) { |
-} |
- |
-WindowTreeHostWin::~WindowTreeHostWin() { |
- DestroyCompositor(); |
- DestroyDispatcher(); |
- window_.reset(); |
-} |
- |
-ui::EventSource* WindowTreeHostWin::GetEventSource() { |
- return this; |
-} |
- |
-gfx::AcceleratedWidget WindowTreeHostWin::GetAcceleratedWidget() { |
- return widget_; |
-} |
- |
-void WindowTreeHostWin::ShowImpl() { |
- window_->Show(); |
-} |
- |
-void WindowTreeHostWin::HideImpl() { |
- window_->Hide(); |
-} |
- |
-gfx::Rect WindowTreeHostWin::GetBounds() const { |
- return window_->GetBounds(); |
-} |
- |
-void WindowTreeHostWin::SetBounds(const gfx::Rect& bounds) { |
- window_->SetBounds(bounds); |
-} |
- |
-gfx::Point WindowTreeHostWin::GetLocationOnNativeScreen() const { |
- return window_->GetBounds().origin(); |
-} |
- |
-void WindowTreeHostWin::SetCapture() { |
- if (!has_capture_) { |
- has_capture_ = true; |
- window_->SetCapture(); |
- } |
-} |
- |
-void WindowTreeHostWin::ReleaseCapture() { |
- if (has_capture_) |
- window_->ReleaseCapture(); |
-} |
- |
-void WindowTreeHostWin::SetCursorNative(gfx::NativeCursor native_cursor) { |
- // Custom web cursors are handled directly. |
- if (native_cursor == ui::kCursorCustom) |
- return; |
- |
- ui::CursorLoaderWin cursor_loader; |
- cursor_loader.SetPlatformCursor(&native_cursor); |
- ::SetCursor(native_cursor.platform()); |
-} |
- |
-void WindowTreeHostWin::MoveCursorToNative(const gfx::Point& location) { |
- // Deliberately not implemented. |
-} |
- |
-void WindowTreeHostWin::OnCursorVisibilityChangedNative(bool show) { |
- NOTIMPLEMENTED(); |
-} |
- |
-void WindowTreeHostWin::OnBoundsChanged(const gfx::Rect& new_bounds) { |
- gfx::Rect old_bounds = bounds_; |
- bounds_ = new_bounds; |
- if (bounds_.origin() != old_bounds.origin()) |
- OnHostMoved(bounds_.origin()); |
- if (bounds_.size() != old_bounds.size()) |
- OnHostResized(bounds_.size()); |
-} |
- |
-void WindowTreeHostWin::OnDamageRect(const gfx::Rect& damage_rect) { |
- compositor()->ScheduleRedrawRect(damage_rect); |
-} |
- |
-void WindowTreeHostWin::DispatchEvent(ui::Event* event) { |
- ui::EventDispatchDetails details = SendEventToProcessor(event); |
- if (details.dispatcher_destroyed) |
- event->SetHandled(); |
-} |
- |
-void WindowTreeHostWin::OnCloseRequest() { |
- // TODO: this obviously shouldn't be here. |
- base::MessageLoopForUI::current()->QuitWhenIdle(); |
-} |
- |
-void WindowTreeHostWin::OnClosed() { |
-} |
- |
-void WindowTreeHostWin::OnWindowStateChanged( |
- ui::PlatformWindowState new_state) { |
-} |
- |
-void WindowTreeHostWin::OnLostCapture() { |
- if (has_capture_) { |
- has_capture_ = false; |
- OnHostLostWindowCapture(); |
- } |
-} |
- |
-void WindowTreeHostWin::OnAcceleratedWidgetAvailable( |
- gfx::AcceleratedWidget widget, |
- float device_pixel_ratio) { |
- widget_ = widget; |
- CreateCompositor(); |
- WindowTreeHost::OnAcceleratedWidgetAvailable(); |
-} |
- |
-void WindowTreeHostWin::OnActivationChanged(bool active) { |
- if (active) |
- OnHostActivated(); |
-} |
- |
-} // namespace aura |