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 | |
8 #include <vector> | |
9 | |
10 #include "chrome/browser/ui/webui/options2/options_ui.h" | |
11 #include "ui/aura/display_observer.h" | |
12 | |
13 namespace base { | |
14 class DictionaryValue; | |
15 class ListValue; | |
16 } | |
17 | |
18 namespace chromeos { | |
19 namespace options { | |
20 | |
21 // Display options overlay page UI handler. | |
22 class DisplayOptionsHandler : public ::options::OptionsPageUIHandler, | |
23 public aura::DisplayObserver { | |
24 public: | |
25 DisplayOptionsHandler(); | |
26 virtual ~DisplayOptionsHandler(); | |
27 | |
28 // OptionsPageUIHandler implementation. | |
29 virtual void GetLocalizedValues( | |
30 base::DictionaryValue* localized_strings) OVERRIDE; | |
31 virtual void InitializePage() OVERRIDE; | |
32 | |
33 // WebUIMessageHandler implementation. | |
34 virtual void RegisterMessages() OVERRIDE; | |
35 | |
36 // aura::DisplayObserver implementation. | |
37 virtual void OnDisplayBoundsChanged(const gfx::Display& display) OVERRIDE; | |
38 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; | |
39 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; | |
40 | |
41 private: | |
42 // Updates the display section visibility based on the current display | |
43 // configurations. | |
44 void UpdateDisplaySectionVisibility(); | |
45 | |
46 // Sends the current display information to the web_ui of options page. | |
47 void SendDisplayInfo(); | |
48 | |
49 // Called when the fade-out animation for mirroring status change is finished. | |
50 void FadeOutForMirroringFinished(bool is_mirroring); | |
51 | |
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 FadeOutForDisplayLayoutFinished(int layout, int offset); | |
57 | |
58 // Handlers of JS messages. | |
59 void HandleDisplayInfo(const base::ListValue* unused_args); | |
60 void HandleMirroring(const base::ListValue* args); | |
61 void HandleDisplayLayout(const base::ListValue* args); | |
62 | |
63 DISALLOW_COPY_AND_ASSIGN(DisplayOptionsHandler); | |
64 }; | |
65 | |
66 } // namespace options | |
67 } // namespace chromeos | |
68 | |
69 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_DISPLAY_OPTIONS_HANDLER_H_ | |
OLD | NEW |