diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-22 04:08:05 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-22 04:08:05 +0000 |
commit | ed1e9c2093ba555d68ab5f27d72c7dcc7337f324 (patch) | |
tree | af001b2f9893dfc9067668128aa0263a5a60f09d /ash | |
parent | 0f67ca77f0f9ccee94a77e697f86c031ceba9f6d (diff) | |
download | chromium_src-ed1e9c2093ba555d68ab5f27d72c7dcc7337f324.zip chromium_src-ed1e9c2093ba555d68ab5f27d72c7dcc7337f324.tar.gz chromium_src-ed1e9c2093ba555d68ab5f27d72c7dcc7337f324.tar.bz2 |
ash: Remove WindowFrame since it's not used anywhere anymore.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/10832431
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152727 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/ash.gyp | 2 | ||||
-rw-r--r-- | ash/wm/window_frame.cc | 13 | ||||
-rw-r--r-- | ash/wm/window_frame.h | 29 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_event_filter.cc | 36 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_event_filter.h | 14 |
5 files changed, 1 insertions, 93 deletions
diff --git a/ash/ash.gyp b/ash/ash.gyp index ceaa0a9..0e6baef 100644 --- a/ash/ash.gyp +++ b/ash/ash.gyp @@ -318,8 +318,6 @@ 'wm/window_cycle_controller.h', 'wm/window_cycle_list.cc', 'wm/window_cycle_list.h', - 'wm/window_frame.cc', - 'wm/window_frame.h', 'wm/window_modality_controller.cc', 'wm/window_modality_controller.h', 'wm/window_properties.cc', diff --git a/ash/wm/window_frame.cc b/ash/wm/window_frame.cc deleted file mode 100644 index 1cd2f4c..0000000 --- a/ash/wm/window_frame.cc +++ /dev/null @@ -1,13 +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 "ash/wm/window_frame.h" - -#include "ui/aura/window_property.h" - -DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(ASH_EXPORT, ash::WindowFrame*); - -namespace ash { -DEFINE_WINDOW_PROPERTY_KEY(WindowFrame*, kWindowFrameKey, NULL); -} // namespace ash diff --git a/ash/wm/window_frame.h b/ash/wm/window_frame.h deleted file mode 100644 index 696edf4..0000000 --- a/ash/wm/window_frame.h +++ /dev/null @@ -1,29 +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. - -#ifndef ASH_WM_WINDOW_FRAME_H_ -#define ASH_WM_WINDOW_FRAME_H_ - -#include "ash/ash_export.h" -#include "ui/aura/window.h" - -namespace ash { - -// Interface for clients implementing a window frame. Implementors should -// add a pointer to this interface to each aura::Window, using the key above. -class ASH_EXPORT WindowFrame { - public: - virtual ~WindowFrame() {} - - // Called when the mouse enters or exits a top-level window. - virtual void OnWindowHoverChanged(bool hovered) = 0; -}; - -// aura::Window property name for a pointer to the WindowFrame interface. -ASH_EXPORT extern const aura::WindowProperty<WindowFrame*>* const - kWindowFrameKey; - -} // namespace ash - -#endif // ASH_WM_WINDOW_FRAME_H_ diff --git a/ash/wm/workspace/workspace_event_filter.cc b/ash/wm/workspace/workspace_event_filter.cc index 8b64a62..8ed9704 100644 --- a/ash/wm/workspace/workspace_event_filter.cc +++ b/ash/wm/workspace/workspace_event_filter.cc @@ -6,7 +6,6 @@ #include "ash/screen_ash.h" #include "ash/wm/property_util.h" -#include "ash/wm/window_frame.h" #include "ash/wm/window_util.h" #include "ash/wm/workspace/workspace_window_resizer.h" #include "ui/aura/client/aura_constants.h" @@ -20,17 +19,6 @@ namespace ash { namespace { -// Sends OnWindowHoveredChanged(|hovered|) to the WindowFrame for |window|, -// which may be NULL. -void WindowHoverChanged(aura::Window* window, bool hovered) { - if (!window) - return; - WindowFrame* window_frame = window->GetProperty(kWindowFrameKey); - if (!window_frame) - return; - window_frame->OnWindowHoverChanged(hovered); -} - void SingleAxisMaximize(aura::Window* window, const gfx::Rect& maximize_rect) { gfx::Rect bounds_in_screen = ScreenAsh::ConvertRectToScreen(window->parent(), window->bounds()); @@ -68,15 +56,12 @@ namespace internal { WorkspaceEventFilter::WorkspaceEventFilter(aura::Window* owner) : ToplevelWindowEventFilter(owner), - hovered_window_(NULL), destroyed_(NULL) { } WorkspaceEventFilter::~WorkspaceEventFilter() { if (destroyed_) *destroyed_ = true; - if (hovered_window_) - hovered_window_->RemoveObserver(this); } bool WorkspaceEventFilter::PreHandleMouseEvent(aura::Window* target, @@ -91,11 +76,9 @@ bool WorkspaceEventFilter::PreHandleMouseEvent(aura::Window* target, break; } case ui::ET_MOUSE_ENTERED: - UpdateHoveredWindow(wm::GetActivatableWindow(target)); break; case ui::ET_MOUSE_CAPTURE_CHANGED: case ui::ET_MOUSE_EXITED: - UpdateHoveredWindow(NULL); break; case ui::ET_MOUSE_PRESSED: { if (event->flags() & ui::EF_IS_DOUBLE_CLICK && @@ -118,12 +101,6 @@ bool WorkspaceEventFilter::PreHandleMouseEvent(aura::Window* target, return ToplevelWindowEventFilter::PreHandleMouseEvent(target, event); } -void WorkspaceEventFilter::OnWindowDestroyed(aura::Window* window) { - DCHECK_EQ(hovered_window_, window); - hovered_window_->RemoveObserver(this); - hovered_window_ = NULL; -} - WindowResizer* WorkspaceEventFilter::CreateWindowResizer( aura::Window* window, const gfx::Point& point_in_parent, @@ -139,19 +116,6 @@ WindowResizer* WorkspaceEventFilter::CreateWindowResizer( std::vector<aura::Window*>()); } -void WorkspaceEventFilter::UpdateHoveredWindow( - aura::Window* toplevel_window) { - if (toplevel_window == hovered_window_) - return; - if (hovered_window_) - hovered_window_->RemoveObserver(this); - WindowHoverChanged(hovered_window_, false); - hovered_window_ = toplevel_window; - WindowHoverChanged(hovered_window_, true); - if (hovered_window_) - hovered_window_->AddObserver(this); -} - void WorkspaceEventFilter::HandleVerticalResizeDoubleClick( aura::Window* target, ui::MouseEvent* event) { diff --git a/ash/wm/workspace/workspace_event_filter.h b/ash/wm/workspace/workspace_event_filter.h index 98244b6e..61a4058 100644 --- a/ash/wm/workspace/workspace_event_filter.h +++ b/ash/wm/workspace/workspace_event_filter.h @@ -7,7 +7,6 @@ #include "ash/wm/toplevel_window_event_filter.h" #include "ash/wm/workspace/multi_window_resize_controller.h" -#include "ui/aura/window_observer.h" namespace aura { class Window; @@ -18,8 +17,7 @@ namespace internal { class WorkspaceEventFilterTestHelper; -class WorkspaceEventFilter : public ToplevelWindowEventFilter, - public aura::WindowObserver { +class WorkspaceEventFilter : public ToplevelWindowEventFilter { public: explicit WorkspaceEventFilter(aura::Window* owner); virtual ~WorkspaceEventFilter(); @@ -28,9 +26,6 @@ class WorkspaceEventFilter : public ToplevelWindowEventFilter, virtual bool PreHandleMouseEvent(aura::Window* target, ui::MouseEvent* event) OVERRIDE; - // Overridden from WindowObserver: - virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; - protected: // Overridden from ToplevelWindowEventFilter: virtual WindowResizer* CreateWindowResizer( @@ -41,10 +36,6 @@ class WorkspaceEventFilter : public ToplevelWindowEventFilter, private: friend class WorkspaceEventFilterTestHelper; - // Updates the top-level window under the mouse so that we can change - // the look of the caption area based on mouse-hover. - void UpdateHoveredWindow(aura::Window* toplevel); - // Determines if |event| corresponds to a double click on either the top or // bottom vertical resize edge, and if so toggles the vertical height of the // window between its restored state and the full available height of the @@ -52,9 +43,6 @@ class WorkspaceEventFilter : public ToplevelWindowEventFilter, void HandleVerticalResizeDoubleClick(aura::Window* target, ui::MouseEvent* event); - // Top-level window under the mouse cursor. - aura::Window* hovered_window_; - MultiWindowResizeController multi_window_resize_controller_; // If non-NULL, set to true in the destructor. |