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.
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_DISPLAY_OPTIONS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_DISPLAY_OPTIONS_HANDLER_H_
10 #include "ash/display/display_controller.h"
11 #include "chrome/browser/ui/webui/options/options_ui.h"
14 class DictionaryValue;
21 // Display options overlay page UI handler.
22 class DisplayOptionsHandler : public ::options::OptionsPageUIHandler,
23 public ash::DisplayController::Observer {
25 DisplayOptionsHandler();
26 virtual ~DisplayOptionsHandler();
28 // OptionsPageUIHandler implementation.
29 virtual void GetLocalizedValues(
30 base::DictionaryValue* localized_strings) OVERRIDE;
31 virtual void InitializePage() OVERRIDE;
33 // WebUIMessageHandler implementation.
34 virtual void RegisterMessages() OVERRIDE;
36 // ash::DisplayController::Observer implementation.
37 virtual void OnDisplayConfigurationChanging() OVERRIDE;
38 virtual void OnDisplayConfigurationChanged() OVERRIDE;
41 // Sends all of the current display information to the web_ui of options page.
42 void SendAllDisplayInfo();
44 // Sends the specified display information to the web_ui of options page.
45 void SendDisplayInfo(const std::vector<gfx::Display>& displays);
47 // Called when the fade-out animation for mirroring status change is finished.
48 void OnFadeOutForMirroringFinished(bool is_mirroring);
50 // Called when the fade-out animation for secondary display layout change is
51 // finished. |layout| specifies the four positions of the secondary display
52 // (left/right/top/bottom), and |offset| is the offset length from the
53 // left/top edge of the primary display.
54 void OnFadeOutForDisplayLayoutFinished(int layout, int offset);
56 // Handlers of JS messages.
57 void HandleDisplayInfo(const base::ListValue* unused_args);
58 void HandleMirroring(const base::ListValue* args);
59 void HandleSetPrimary(const base::ListValue* args);
60 void HandleDisplayLayout(const base::ListValue* args);
61 void HandleSetDisplayMode(const base::ListValue* args);
62 void HandleSetOrientation(const base::ListValue* args);
63 void HandleSetColorProfile(const base::ListValue* args);
65 DISALLOW_COPY_AND_ASSIGN(DisplayOptionsHandler);
68 } // namespace options
69 } // namespace chromeos
71 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_DISPLAY_OPTIONS_HANDLER_H_