Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: ash/wm/always_on_top_controller.h

Issue 1923983003: Makes WorkspaceLayoutManager use ash/wm/common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix always-on-top and remove mus changes Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef ASH_WM_ALWAYS_ON_TOP_CONTROLLER_H_ 5 #ifndef ASH_WM_ALWAYS_ON_TOP_CONTROLLER_H_
6 #define ASH_WM_ALWAYS_ON_TOP_CONTROLLER_H_ 6 #define ASH_WM_ALWAYS_ON_TOP_CONTROLLER_H_
7 7
8 #include <memory>
9
8 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
9 #include "base/compiler_specific.h" 11 #include "ash/wm/common/wm_window_observer.h"
10 #include "base/macros.h" 12 #include "base/macros.h"
11 #include "ui/aura/window_observer.h"
12
13 namespace aura {
14 class Window;
15 }
16 13
17 namespace ash { 14 namespace ash {
18 class WorkspaceLayoutManager; 15 class WorkspaceLayoutManager;
19 16
20 // AlwaysOnTopController puts window into proper containers based on its 17 // AlwaysOnTopController puts window into proper containers based on its
21 // 'AlwaysOnTop' property. That is, putting a window into the worskpace 18 // 'AlwaysOnTop' property. That is, putting a window into the worskpace
22 // container if its "AlwaysOnTop" property is false. Otherwise, put it in 19 // container if its "AlwaysOnTop" property is false. Otherwise, put it in
23 // |always_on_top_container_|. 20 // |always_on_top_container_|.
24 class ASH_EXPORT AlwaysOnTopController : public aura::WindowObserver { 21 class ASH_EXPORT AlwaysOnTopController : public wm::WmWindowObserver {
25 public: 22 public:
26 explicit AlwaysOnTopController(aura::Window* viewport); 23 explicit AlwaysOnTopController(wm::WmWindow* viewport);
27 ~AlwaysOnTopController() override; 24 ~AlwaysOnTopController() override;
28 25
29 // Gets container for given |window| based on its "AlwaysOnTop" property. 26 // Gets container for given |window| based on its "AlwaysOnTop" property.
30 aura::Window* GetContainer(aura::Window* window) const; 27 wm::WmWindow* GetContainer(wm::WmWindow* window) const;
31 28
32 WorkspaceLayoutManager* GetLayoutManager() const; 29 WorkspaceLayoutManager* GetLayoutManager() const;
33 30
34 void SetLayoutManagerForTest(WorkspaceLayoutManager* layout_manager); 31 void SetLayoutManagerForTest(
32 std::unique_ptr<WorkspaceLayoutManager> layout_manager);
35 33
36 private: 34 private:
37 // Overridden from aura::WindowObserver: 35 // Overridden from wm::WmWindowObserver:
38 void OnWindowAdded(aura::Window* child) override; 36 void OnWindowTreeChanged(wm::WmWindow* window,
39 void OnWillRemoveWindow(aura::Window* child) override; 37 const TreeChangeParams& params) override;
40 void OnWindowPropertyChanged(aura::Window* window, 38 void OnWindowPropertyChanged(wm::WmWindow* window,
41 const void* key, 39 wm::WmWindowProperty property,
42 intptr_t old) override; 40 intptr_t old) override;
43 void OnWindowDestroyed(aura::Window* window) override; 41 void OnWindowDestroying(wm::WmWindow* window) override;
44 42
45 aura::Window* always_on_top_container_; 43 wm::WmWindow* always_on_top_container_;
46 44
47 DISALLOW_COPY_AND_ASSIGN(AlwaysOnTopController); 45 DISALLOW_COPY_AND_ASSIGN(AlwaysOnTopController);
48 }; 46 };
49 47
50 } // namepsace ash 48 } // namepsace ash
51 49
52 #endif // ASH_WM_ALWAYS_ON_TOP_CONTROLLER_H_ 50 #endif // ASH_WM_ALWAYS_ON_TOP_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698