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

Side by Side Diff: ash/common/wm/window_dimmer.h

Issue 2699033002: Replace WmWindowObserver with aura::WindowObserver. (Closed)
Patch Set: Check for null images in ShelfWindowWatcher. Created 3 years, 10 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
« no previous file with comments | « ash/common/wm/window_cycle_list.cc ('k') | ash/common/wm/window_dimmer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_COMMON_WINDOW_DIMMER_H_ 5 #ifndef ASH_COMMON_WINDOW_DIMMER_H_
6 #define ASH_COMMON_WINDOW_DIMMER_H_ 6 #define ASH_COMMON_WINDOW_DIMMER_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/common/wm_window_observer.h"
10 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "ui/aura/window_observer.h"
11 11
12 namespace ash { 12 namespace ash {
13 13
14 class WmWindow;
15
14 // WindowDimmer creates a window whose opacity is animated by way of 16 // WindowDimmer creates a window whose opacity is animated by way of
15 // SetDimOpacity() and whose size matches that of its parent. WindowDimmer is 17 // SetDimOpacity() and whose size matches that of its parent. WindowDimmer is
16 // intended to be used in cases where a certain set of windows need to appear 18 // intended to be used in cases where a certain set of windows need to appear
17 // partially obscured. This is achieved by creating WindowDimmer, setting the 19 // partially obscured. This is achieved by creating WindowDimmer, setting the
18 // opacity, and then stacking window() above the windows that are to appear 20 // opacity, and then stacking window() above the windows that are to appear
19 // obscured. The window created by WindowDimmer is owned by the parent, but also 21 // obscured. The window created by WindowDimmer is owned by the parent, but also
20 // deleted if WindowDimmer is deleted. It is expected that WindowDimmer is 22 // deleted if WindowDimmer is deleted. It is expected that WindowDimmer is
21 // deleted when the parent window is deleted (such as happens with 23 // deleted when the parent window is deleted (such as happens with
22 // WmWindowUserData). 24 // WmWindowUserData).
23 class ASH_EXPORT WindowDimmer : public WmWindowObserver { 25 class ASH_EXPORT WindowDimmer : public aura::WindowObserver {
24 public: 26 public:
25 // Creates a new WindowDimmer. The window() created by WindowDimmer is added 27 // Creates a new WindowDimmer. The window() created by WindowDimmer is added
26 // to |parent| and stacked above all other child windows. 28 // to |parent| and stacked above all other child windows.
27 explicit WindowDimmer(WmWindow* parent); 29 explicit WindowDimmer(WmWindow* parent);
28 ~WindowDimmer() override; 30 ~WindowDimmer() override;
29 31
30 void SetDimOpacity(float target_opacity); 32 void SetDimOpacity(float target_opacity);
31 33
32 WmWindow* parent() { return parent_; } 34 WmWindow* parent() { return parent_; }
33 WmWindow* window() { return window_; } 35 WmWindow* window() { return window_; }
34 36
35 // NOTE: WindowDimmer is an observer for both |parent_| and |window_|. 37 // NOTE: WindowDimmer is an observer for both |parent_| and |window_|.
36 // WmWindowObserver: 38 // aura::WindowObserver:
37 void OnWindowBoundsChanged(WmWindow* window, 39 void OnWindowBoundsChanged(aura::Window* window,
38 const gfx::Rect& old_bounds, 40 const gfx::Rect& old_bounds,
39 const gfx::Rect& new_bounds) override; 41 const gfx::Rect& new_bounds) override;
40 void OnWindowDestroying(WmWindow* window) override; 42 void OnWindowDestroying(aura::Window* window) override;
41 void OnWindowTreeChanging(WmWindow* window, 43 void OnWindowHierarchyChanging(const HierarchyChangeParams& params) override;
42 const TreeChangeParams& params) override;
43 44
44 private: 45 private:
45 WmWindow* parent_; 46 WmWindow* parent_;
46 WmWindow* window_; 47 WmWindow* window_;
47 48
48 DISALLOW_COPY_AND_ASSIGN(WindowDimmer); 49 DISALLOW_COPY_AND_ASSIGN(WindowDimmer);
49 }; 50 };
50 51
51 } // namespace ash 52 } // namespace ash
52 53
53 #endif // ASH_COMMON_WINDOW_DIMMER_H_ 54 #endif // ASH_COMMON_WINDOW_DIMMER_H_
OLDNEW
« no previous file with comments | « ash/common/wm/window_cycle_list.cc ('k') | ash/common/wm/window_dimmer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698