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/window_tree_host_manager.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::WindowTreeHostManager::Observer
{
25 DisplayOptionsHandler();
26 ~DisplayOptionsHandler() override
;
28 // OptionsPageUIHandler implementation.
29 void GetLocalizedValues(base::DictionaryValue
* localized_strings
) override
;
30 void InitializePage() override
;
32 // WebUIMessageHandler implementation.
33 void RegisterMessages() override
;
35 // ash::WindowTreeHostManager::Observer implementation.
36 void OnDisplayConfigurationChanging() override
;
37 void OnDisplayConfigurationChanged() override
;
40 // Sends all of the current display information to the web_ui of options page.
41 void SendAllDisplayInfo();
43 // Sends the specified display information to the web_ui of options page.
44 void SendDisplayInfo(const std::vector
<gfx::Display
>& displays
);
46 // Enables or disables the display settings UI.
47 void UpdateDisplaySettingsEnabled();
49 // Called when the fade-out animation for mirroring status change is finished.
50 void OnFadeOutForMirroringFinished(bool is_mirroring
);
52 // Called when the fade-out animation for secondary display layout change is
53 // finished. |layout| specifies the four positions of the secondary display
54 // (left/right/top/bottom), and |offset| is the offset length from the
55 // left/top edge of the primary display.
56 void OnFadeOutForDisplayLayoutFinished(int layout
, int offset
);
58 // Handlers of JS messages.
59 void HandleDisplayInfo(const base::ListValue
* unused_args
);
60 void HandleMirroring(const base::ListValue
* args
);
61 void HandleSetPrimary(const base::ListValue
* args
);
62 void HandleDisplayLayout(const base::ListValue
* args
);
63 void HandleSetDisplayMode(const base::ListValue
* args
);
64 void HandleSetOrientation(const base::ListValue
* args
);
65 void HandleSetColorProfile(const base::ListValue
* args
);
66 void HandleSetUnifiedDesktopEnabled(const base::ListValue
* args
);
68 DISALLOW_COPY_AND_ASSIGN(DisplayOptionsHandler
);
71 } // namespace options
72 } // namespace chromeos
74 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_DISPLAY_OPTIONS_HANDLER_H_