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

Side by Side Diff: components/exo/shell_surface.h

Issue 2407303003: exo: Use WMHelper to access ash accessibility related features. (Closed)
Patch Set: Fix compile errors. Created 4 years, 2 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 | « no previous file | components/exo/shell_surface.cc » ('j') | components/exo/shell_surface.cc » ('J')
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 COMPONENTS_EXO_SHELL_SURFACE_H_ 5 #ifndef COMPONENTS_EXO_SHELL_SURFACE_H_
6 #define COMPONENTS_EXO_SHELL_SURFACE_H_ 6 #define COMPONENTS_EXO_SHELL_SURFACE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 11
12 #include "ash/common/system/accessibility_observer.h"
13 #include "ash/common/wm/window_state_observer.h" 12 #include "ash/common/wm/window_state_observer.h"
14 #include "base/macros.h" 13 #include "base/macros.h"
15 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
16 #include "components/exo/surface_delegate.h" 15 #include "components/exo/surface_delegate.h"
17 #include "components/exo/surface_observer.h" 16 #include "components/exo/surface_observer.h"
18 #include "components/exo/wm_helper.h" 17 #include "components/exo/wm_helper.h"
19 #include "ui/aura/window_observer.h" 18 #include "ui/aura/window_observer.h"
20 #include "ui/base/hit_test.h" 19 #include "ui/base/hit_test.h"
21 #include "ui/gfx/geometry/point.h" 20 #include "ui/gfx/geometry/point.h"
22 #include "ui/gfx/geometry/rect.h" 21 #include "ui/gfx/geometry/rect.h"
(...skipping 13 matching lines...) Expand all
36 namespace exo { 35 namespace exo {
37 class Surface; 36 class Surface;
38 37
39 // This class provides functions for treating a surfaces like toplevel, 38 // This class provides functions for treating a surfaces like toplevel,
40 // fullscreen or popup widgets, move, resize or maximize them, associate 39 // fullscreen or popup widgets, move, resize or maximize them, associate
41 // metadata like title and class, etc. 40 // metadata like title and class, etc.
42 class ShellSurface : public SurfaceDelegate, 41 class ShellSurface : public SurfaceDelegate,
43 public SurfaceObserver, 42 public SurfaceObserver,
44 public views::WidgetDelegate, 43 public views::WidgetDelegate,
45 public views::View, 44 public views::View,
46 public ash::AccessibilityObserver,
47 public ash::wm::WindowStateObserver, 45 public ash::wm::WindowStateObserver,
48 public aura::WindowObserver, 46 public aura::WindowObserver,
49 public WMHelper::ActivationObserver { 47 public WMHelper::ActivationObserver,
48 public WMHelper::AccessibilityObserver {
50 public: 49 public:
51 ShellSurface(Surface* surface, 50 ShellSurface(Surface* surface,
52 ShellSurface* parent, 51 ShellSurface* parent,
53 const gfx::Rect& initial_bounds, 52 const gfx::Rect& initial_bounds,
54 bool activatable, 53 bool activatable,
55 int container); 54 int container);
56 explicit ShellSurface(Surface* surface); 55 explicit ShellSurface(Surface* surface);
57 ~ShellSurface() override; 56 ~ShellSurface() override;
58 57
59 // Set the callback to run when the user wants the shell surface to be closed. 58 // Set the callback to run when the user wants the shell surface to be closed.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 const views::Widget* GetWidget() const override; 188 const views::Widget* GetWidget() const override;
190 views::View* GetContentsView() override; 189 views::View* GetContentsView() override;
191 views::NonClientFrameView* CreateNonClientFrameView( 190 views::NonClientFrameView* CreateNonClientFrameView(
192 views::Widget* widget) override; 191 views::Widget* widget) override;
193 bool WidgetHasHitTestMask() const override; 192 bool WidgetHasHitTestMask() const override;
194 void GetWidgetHitTestMask(gfx::Path* mask) const override; 193 void GetWidgetHitTestMask(gfx::Path* mask) const override;
195 194
196 // Overridden from views::View: 195 // Overridden from views::View:
197 gfx::Size GetPreferredSize() const override; 196 gfx::Size GetPreferredSize() const override;
198 197
199 // Overridden from ash::AccessibilityObserver:
200 void OnAccessibilityModeChanged(
201 ash::AccessibilityNotificationVisibility notify) override;
202
203 // Overridden from ash::wm::WindowStateObserver: 198 // Overridden from ash::wm::WindowStateObserver:
204 void OnPreWindowStateTypeChange(ash::wm::WindowState* window_state, 199 void OnPreWindowStateTypeChange(ash::wm::WindowState* window_state,
205 ash::wm::WindowStateType old_type) override; 200 ash::wm::WindowStateType old_type) override;
206 void OnPostWindowStateTypeChange(ash::wm::WindowState* window_state, 201 void OnPostWindowStateTypeChange(ash::wm::WindowState* window_state,
207 ash::wm::WindowStateType old_type) override; 202 ash::wm::WindowStateType old_type) override;
208 203
209 // Overridden from aura::WindowObserver: 204 // Overridden from aura::WindowObserver:
210 void OnWindowBoundsChanged(aura::Window* window, 205 void OnWindowBoundsChanged(aura::Window* window,
211 const gfx::Rect& old_bounds, 206 const gfx::Rect& old_bounds,
212 const gfx::Rect& new_bounds) override; 207 const gfx::Rect& new_bounds) override;
213 void OnWindowDestroying(aura::Window* window) override; 208 void OnWindowDestroying(aura::Window* window) override;
214 209
215 // Overridden from WMHelper::ActivationObserver: 210 // Overridden from WMHelper::ActivationObserver:
216 void OnWindowActivated( 211 void OnWindowActivated(
217 aura::Window* gained_active, 212 aura::Window* gained_active,
218 aura::Window* lost_active) override; 213 aura::Window* lost_active) override;
219 214
215 // Overridden from WMHelper::AccessibilityObserver:
216 void OnAccessibilityModeChanged() override;
217
220 // Overridden from ui::EventHandler: 218 // Overridden from ui::EventHandler:
221 void OnKeyEvent(ui::KeyEvent* event) override; 219 void OnKeyEvent(ui::KeyEvent* event) override;
222 void OnMouseEvent(ui::MouseEvent* event) override; 220 void OnMouseEvent(ui::MouseEvent* event) override;
223 221
224 // Overridden from ui::AcceleratorTarget: 222 // Overridden from ui::AcceleratorTarget:
225 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; 223 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
226 224
227 aura::Window* shadow_underlay() { return shadow_underlay_; } 225 aura::Window* shadow_underlay() { return shadow_underlay_; }
228 226
229 private: 227 private:
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 int top_inset_height_ = 0; 301 int top_inset_height_ = 0;
304 int pending_top_inset_height_ = 0; 302 int pending_top_inset_height_ = 0;
305 float rectangular_shadow_background_opacity_ = 1.0; 303 float rectangular_shadow_background_opacity_ = 1.0;
306 304
307 DISALLOW_COPY_AND_ASSIGN(ShellSurface); 305 DISALLOW_COPY_AND_ASSIGN(ShellSurface);
308 }; 306 };
309 307
310 } // namespace exo 308 } // namespace exo
311 309
312 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ 310 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_
OLDNEW
« no previous file with comments | « no previous file | components/exo/shell_surface.cc » ('j') | components/exo/shell_surface.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698