| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 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 | 
|  | 3 // found in the LICENSE file. | 
|  | 4 | 
|  | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_DISPLAY_OPTIONS_HANDLER_H_ | 
|  | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_DISPLAY_OPTIONS_HANDLER_H_ | 
|  | 7 #pragma once | 
|  | 8 | 
|  | 9 #include <vector> | 
|  | 10 | 
|  | 11 #include "chrome/browser/ui/webui/options2/options_ui2.h" | 
|  | 12 #include "ui/aura/display_observer.h" | 
|  | 13 | 
|  | 14 namespace base { | 
|  | 15 class ListValue; | 
|  | 16 } | 
|  | 17 | 
|  | 18 namespace chromeos { | 
|  | 19 namespace options2 { | 
|  | 20 | 
|  | 21 // Display options overlay page UI handler. | 
|  | 22 class DisplayOptionsHandler : public ::options2::OptionsPageUIHandler, | 
|  | 23                               public aura::DisplayObserver { | 
|  | 24  public: | 
|  | 25   DisplayOptionsHandler(); | 
|  | 26   virtual ~DisplayOptionsHandler(); | 
|  | 27 | 
|  | 28   // OptionsPageUIHandler implementation. | 
|  | 29   virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; | 
|  | 30   virtual void InitializeHandler() OVERRIDE; | 
|  | 31 | 
|  | 32   // WebUIMessageHandler implementation. | 
|  | 33   virtual void RegisterMessages() OVERRIDE; | 
|  | 34 | 
|  | 35   // aura::DisplayObserver implementation. | 
|  | 36   virtual void OnDisplayBoundsChanged(const gfx::Display& display) OVERRIDE; | 
|  | 37   virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; | 
|  | 38   virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; | 
|  | 39 | 
|  | 40  private: | 
|  | 41   // Updates the display section visibility based on the current display | 
|  | 42   // configurations. | 
|  | 43   void UpdateDisplaySectionVisibility(); | 
|  | 44 | 
|  | 45   // Sends the current display information to the web_ui of options page. | 
|  | 46   void SendDisplayInfo(); | 
|  | 47 | 
|  | 48   // Handlers of JS messages. | 
|  | 49   void HandleDisplayInfo(const base::ListValue* unused_args); | 
|  | 50   void HandleMirroring(const base::ListValue* args); | 
|  | 51   void HandleDisplayLayout(const base::ListValue* args); | 
|  | 52 | 
|  | 53   DISALLOW_COPY_AND_ASSIGN(DisplayOptionsHandler); | 
|  | 54 }; | 
|  | 55 | 
|  | 56 }  // namespace options2 | 
|  | 57 }  // namespace chromeos | 
|  | 58 | 
|  | 59 #endif  // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_DISPLAY_OPTIONS_HANDLER_H_ | 
| OLD | NEW | 
|---|