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

Side by Side Diff: ash/display/mirror_window_controller.h

Issue 201573015: Introdcue AshWindowTreeHost and move ash/chrome specific code in WTH to ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_ 5 #ifndef ASH_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_
6 #define ASH_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_ 6 #define ASH_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "ui/aura/window_tree_host.h"
13 #include "ui/aura/window_tree_host_observer.h" 12 #include "ui/aura/window_tree_host_observer.h"
14 #include "ui/gfx/display.h" 13 #include "ui/gfx/display.h"
15 #include "ui/gfx/native_widget_types.h" 14 #include "ui/gfx/native_widget_types.h"
16 #include "ui/gfx/point.h" 15 #include "ui/gfx/point.h"
17 #include "ui/gfx/size.h" 16 #include "ui/gfx/size.h"
18 17
19 namespace aura { 18 namespace aura {
20 class RootWindowTransformer;
21 class Window; 19 class Window;
22 } 20 }
23 21
24 namespace ui { 22 namespace ui {
25 class Reflector; 23 class Reflector;
26 } 24 }
27 25
28 namespace ash { 26 namespace ash {
27 class AshWindowTreeHost;
28 class RootWindowTransformer;
29 namespace test{ 29 namespace test{
30 class MirrorWindowTestApi; 30 class MirrorWindowTestApi;
31 } 31 }
32 32
33 namespace internal { 33 namespace internal {
34 class DisplayInfo; 34 class DisplayInfo;
35 35
36 // An object that copies the content of the primary root window to a 36 // An object that copies the content of the primary root window to a
37 // mirror window. This also draws a mouse cursor as the mouse cursor 37 // mirror window. This also draws a mouse cursor as the mouse cursor
38 // is typically drawn by the window system. 38 // is typically drawn by the window system.
39 class ASH_EXPORT MirrorWindowController : public aura::WindowTreeHostObserver { 39 class ASH_EXPORT MirrorWindowController : public aura::WindowTreeHostObserver {
40 public: 40 public:
41 MirrorWindowController(); 41 MirrorWindowController();
42 virtual ~MirrorWindowController(); 42 virtual ~MirrorWindowController();
43 43
44 // Updates the root window's bounds using |display_info|. 44 // Updates the root window's bounds using |display_info|.
45 // Creates the new root window if one doesn't exist. 45 // Creates the new root window if one doesn't exist.
46 void UpdateWindow(const DisplayInfo& display_info); 46 void UpdateWindow(const DisplayInfo& display_info);
47 47
48 // Same as above, but using existing display info 48 // Same as above, but using existing display info
49 // for the mirrored display. 49 // for the mirrored display.
50 void UpdateWindow(); 50 void UpdateWindow();
51 51
52 // Close the mirror window. 52 // Close the mirror window.
53 void Close(); 53 void Close();
54 54
55 // aura::WindowTreeHostObserver overrides: 55 // aura::WindowTreeHostObserver overrides:
56 virtual void OnHostResized(const aura::WindowTreeHost* host) OVERRIDE; 56 virtual void OnHostResized(const aura::WindowTreeHost* host) OVERRIDE;
57 57
58 aura::WindowTreeHost* host() const { return host_.get(); } 58 AshWindowTreeHost* ash_host() const { return ash_host_.get(); }
59 59
60 private: 60 private:
61 friend class test::MirrorWindowTestApi; 61 friend class test::MirrorWindowTestApi;
62 62
63 // Creates a RootWindowTransformer for current display 63 // Creates a RootWindowTransformer for current display
64 // configuration. 64 // configuration.
65 scoped_ptr<aura::RootWindowTransformer> CreateRootWindowTransformer() const; 65 scoped_ptr<RootWindowTransformer> CreateRootWindowTransformer() const;
66 66
67 scoped_ptr<aura::WindowTreeHost> host_; 67 scoped_ptr<AshWindowTreeHost> ash_host_;
68 gfx::Size mirror_window_host_size_; 68 gfx::Size mirror_window_host_size_;
69 scoped_refptr<ui::Reflector> reflector_; 69 scoped_refptr<ui::Reflector> reflector_;
70 70
71 DISALLOW_COPY_AND_ASSIGN(MirrorWindowController); 71 DISALLOW_COPY_AND_ASSIGN(MirrorWindowController);
72 }; 72 };
73 73
74 } // namespace internal 74 } // namespace internal
75 } // namespace ash 75 } // namespace ash
76 76
77 #endif // ASH_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_ 77 #endif // ASH_DISPLAY_MIRROR_WINDOW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698