15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef ASH_DISPLAY_DISPLAY_CONTROLLER_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define ASH_DISPLAY_DISPLAY_CONTROLLER_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <map>
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <vector>
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ash/ash_export.h"
127dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "ash/display/display_manager.h"
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/basictypes.h"
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/compiler_specific.h"
15ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch#include "base/gtest_prod_util.h"
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/memory/scoped_ptr.h"
17f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)#include "base/memory/weak_ptr.h"
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/observer_list.h"
19eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "base/time/time.h"
20f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#include "ui/aura/window.h"
21a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "ui/aura/window_tree_host_observer.h"
222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "ui/gfx/display_observer.h"
237dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "ui/gfx/point.h"
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace aura {
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Display;
27a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class WindowTreeHost;
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace base {
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Value;
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)template <typename T> class JSONValueConverter;
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
35eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochnamespace gfx {
36eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochclass Display;
37eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochclass Insets;
38eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch}
39eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace ash {
41a02191e04bc25c4935f804f2c080ae28663d096dBen Murdochclass AshWindowTreeHost;
42cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)struct AshWindowTreeHostInitParams;
435d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class CursorWindowController;
447dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdochclass DisplayInfo;
452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class DisplayManager;
46c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)class FocusActivationStore;
47eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochclass MirrorWindowController;
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class RootWindowController;
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// DisplayController owns and maintains RootWindows for each attached
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// display, keeping them in sync with display configuration changes.
527dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdochclass ASH_EXPORT DisplayController : public gfx::DisplayObserver,
53a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)                                     public aura::WindowTreeHostObserver,
54c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch                                     public DisplayManager::Delegate {
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public:
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  class ASH_EXPORT Observer {
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   public:
58a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    // Invoked only once after all displays are initialized
59a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    // after startup.
60a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    virtual void OnDisplaysInitialized() {}
61a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // Invoked when the display configuration change is requested,
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // but before the change is applied to aura/ash.
64868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    virtual void OnDisplayConfigurationChanging() {}
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    // Invoked when the all display configuration changes
672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    // have been applied.
682a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    virtual void OnDisplayConfigurationChanged() {};
692a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   protected:
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    virtual ~Observer() {}
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  };
735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DisplayController();
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual ~DisplayController();
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void Start();
782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void Shutdown();
792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
805d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // Returns primary display's ID.
815d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // TODO(oshima): Move this out from DisplayController;
825d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  static int64 GetPrimaryDisplayId();
835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
84c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  CursorWindowController* cursor_window_controller() {
855d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    return cursor_window_controller_.get();
865d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  }
872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
88c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  MirrorWindowController* mirror_window_controller() {
897dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch    return mirror_window_controller_.get();
907dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  }
912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
92cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // Create a WindowTreeHost for the primary display. This replaces
93cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // |initial_bounds| in |init_params|.
94cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  void CreatePrimaryHost(const AshWindowTreeHostInitParams& init_params);
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
96a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch  // Initializes all displays.
97a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch  void InitDisplays();
985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Add/Remove observers.
1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void AddObserver(Observer* observer);
1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void RemoveObserver(Observer* observer);
1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns the root window for primary display.
1041e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  aura::Window* GetPrimaryRootWindow();
1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns the root window for |display_id|.
1071e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  aura::Window* GetRootWindowForDisplayId(int64 id);
1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
10990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  // Toggle mirror mode.
11090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  void ToggleMirrorMode();
1112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Swap primary and secondary display.
1132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void SwapPrimaryDisplay();
1142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Sets the ID of the primary display.  If the display is not connected, it
1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // will switch the primary display when connected.
1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void SetPrimaryDisplayId(int64 id);
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Sets primary display. This re-assigns the current root
1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // window to given |display|.
1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void SetPrimaryDisplay(const gfx::Display& display);
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Closes all child windows in the all root windows.
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  void CloseChildWindows();
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns all root windows. In non extended desktop mode, this
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // returns the primary root window only.
128f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  aura::Window::Windows GetAllRootWindows();
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Returns all oot window controllers. In non extended desktop
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // mode, this return a RootWindowController for the primary root window only.
132c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  std::vector<RootWindowController*> GetAllRootWindowControllers();
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Gets/Sets/Clears the overscan insets for the specified |display_id|. See
1352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // display_manager.h for the details.
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  gfx::Insets GetOverscanInsets(int64 display_id) const;
1372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void SetOverscanInsets(int64 display_id, const gfx::Insets& insets_in_dip);
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
139c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // Checks if the mouse pointer is on one of displays, and moves to
140c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // the center of the nearest display if it's outside of all displays.
141c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  void EnsurePointerInDisplays();
142c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
1437dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  // Sets the work area's |insets| to the display assigned to |window|.
1447dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  bool UpdateWorkAreaOfDisplayNearestWindow(const aura::Window* window,
1457dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch                                            const gfx::Insets& insets);
146cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  // gfx::DisplayObserver overrides:
1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnDisplayAdded(const gfx::Display& display) OVERRIDE;
1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  virtual void OnDisplayRemoved(const gfx::Display& display) OVERRIDE;
149cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  virtual void OnDisplayMetricsChanged(const gfx::Display& display,
150cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)                                       uint32_t metrics) OVERRIDE;
1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
152a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // aura::WindowTreeHostObserver overrides:
153a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  virtual void OnHostResized(const aura::WindowTreeHost* host) OVERRIDE;
1547dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch
1557dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  // aura::DisplayManager::Delegate overrides:
156c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  virtual void CreateOrUpdateNonDesktopDisplay(const DisplayInfo& info)
157c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch      OVERRIDE;
1581e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)  virtual void CloseNonDesktopDisplay() OVERRIDE;
159f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  virtual void PreDisplayConfigurationChange(bool clear_focus) OVERRIDE;
1607dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  virtual void PostDisplayConfigurationChange() OVERRIDE;
1617dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private:
163ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch  FRIEND_TEST_ALL_PREFIXES(DisplayControllerTest, BoundsUpdated);
164ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch  FRIEND_TEST_ALL_PREFIXES(DisplayControllerTest, SecondaryDisplayLayout);
165c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  friend class DisplayManager;
166c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  friend class MirrorWindowController;
1672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
168a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch  // Creates a WindowTreeHost for |display| and stores it in the
169a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch  // |window_tree_hosts_| map.
170cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)  AshWindowTreeHost* AddWindowTreeHostForDisplay(
171cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)      const gfx::Display& display,
172cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)      const AshWindowTreeHostInitParams& params);
1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  void OnFadeOutForSwapDisplayFinished();
1752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
176f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)  void SetMirrorModeAfterAnimation(bool mirror);
177f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)
178eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  void UpdateHostWindowNames();
179eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
1802a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  class DisplayChangeLimiter {
1812a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)   public:
1822a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    DisplayChangeLimiter();
1832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1842a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    // Sets how long the throttling should last.
1852a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    void SetThrottleTimeout(int64 throttle_ms);
1862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    bool IsThrottled() const;
1882a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1892a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)   private:
1902a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    // The time when the throttling ends.
1912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    base::Time throttle_timeout_;
1922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    DISALLOW_COPY_AND_ASSIGN(DisplayChangeLimiter);
1942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  };
1952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // The limiter to throttle how fast a user can
1972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // change the display configuration.
1982a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  scoped_ptr<DisplayChangeLimiter> limiter_;
1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
200a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch  typedef std::map<int64, AshWindowTreeHost*> WindowTreeHostMap;
201a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch  // The mapping from display ID to its window tree host.
202a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch  WindowTreeHostMap window_tree_hosts_;
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  ObserverList<Observer> observers_;
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
206a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch  // Store the primary window tree host temporarily while replacing
2072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // display.
208a02191e04bc25c4935f804f2c080ae28663d096dBen Murdoch  AshWindowTreeHost* primary_tree_host_for_replace_;
2092a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
210c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  scoped_ptr<FocusActivationStore> focus_activation_store_;
211c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
212c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  scoped_ptr<CursorWindowController> cursor_window_controller_;
213c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch  scoped_ptr<MirrorWindowController> mirror_window_controller_;
2147dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch
2157dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  // Stores the curent cursor location (in native coordinates) used to
2167dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  // restore the cursor location when display configuration
2177dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  // changed.
2187dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch  gfx::Point cursor_location_in_native_coords_for_restore_;
2197dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch
220f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)  base::WeakPtrFactory<DisplayController> weak_ptr_factory_;
221f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)
2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(DisplayController);
2235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
2245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace ash
2265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // ASH_DISPLAY_DISPLAY_CONTROLLER_H_
228