OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_VIEW_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_VIEW_CHROMEOS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_VIEW_CHROMEOS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_VIEW_CHROMEOS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/chromeos/status/status_area_view.h" | 9 #include "chrome/browser/chromeos/status/status_area_view.h" |
10 | 10 |
11 #include "chrome/browser/chromeos/cros/power_library.h" | 11 #include "chrome/browser/chromeos/cros/power_library.h" |
12 #include "chrome/browser/chromeos/system/timezone_settings.h" | 12 #include "chrome/browser/chromeos/system/timezone_settings.h" |
13 #include "chrome/browser/chromeos/view_ids.h" | 13 #include "chrome/browser/chromeos/view_ids.h" |
14 | 14 |
15 class ClockMenuButton; | |
16 | |
15 namespace chromeos { | 17 namespace chromeos { |
16 | 18 |
17 class StatusAreaViewChromeos : public StatusAreaView, | 19 class StatusAreaViewChromeos : public StatusAreaView, |
18 public PowerLibrary::Observer, | 20 public PowerLibrary::Observer, |
19 public system::TimezoneSettings::Observer { | 21 public system::TimezoneSettings::Observer { |
20 public: | 22 public: |
21 // The type of screen the host window is on. | 23 // The type of screen the host window is on. |
22 enum ScreenMode { | 24 enum ScreenMode { |
23 LOGIN_MODE_VIEWS, // The host is for the views-based OOBE/login screens. | 25 LOGIN_MODE_VIEWS, // The host is for the views-based OOBE/login screens. |
24 LOGIN_MODE_WEBUI, // The host is for the WebUI OOBE/login screens. | 26 LOGIN_MODE_WEBUI, // The host is for the WebUI OOBE/login screens. |
25 BROWSER_MODE, // The host is for browser. | 27 BROWSER_MODE, // The host is for browser. |
26 SCREEN_LOCKER_MODE, // The host is for screen locker. | 28 SCREEN_LOCKER_MODE, // The host is for screen locker. |
27 }; | 29 }; |
28 | 30 |
29 explicit StatusAreaViewChromeos(); | 31 explicit StatusAreaViewChromeos(); |
30 virtual ~StatusAreaViewChromeos(); | 32 virtual ~StatusAreaViewChromeos(); |
31 | 33 |
32 void Init(StatusAreaButton::Delegate* delegate, ScreenMode screen_mode); | 34 void Init(StatusAreaButton::Delegate* delegate, ScreenMode screen_mode); |
33 | 35 |
34 // PowerLibrary::Observer: | 36 // PowerLibrary::Observer: |
35 virtual void SystemResumed() OVERRIDE; | 37 virtual void SystemResumed() OVERRIDE; |
36 | 38 |
37 // TimezoneSettings::Observer: | 39 // TimezoneSettings::Observer: |
38 virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE; | 40 virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE; |
39 | 41 |
40 // Sets default use 24hour clock mode. | 42 // Sets default use 24hour clock mode. |
41 void SetDefaultUse24HourClock(bool use_24hour_clock); | 43 void SetDefaultUse24HourClock(bool use_24hour_clock); |
42 | 44 |
43 // Convenience function to add buttons to a status area for ChromeOS. | 45 // Convenience function to add buttons to a status area for ChromeOS. |
46 // |clock_button| is set to the ClockMenuButton that is created by this | |
47 // method. | |
44 static void AddChromeosButtons(StatusAreaView* status_area, | 48 static void AddChromeosButtons(StatusAreaView* status_area, |
45 StatusAreaButton::Delegate* delegate, | 49 StatusAreaButton::Delegate* delegate, |
46 ScreenMode screen_mode); | 50 ScreenMode screen_mode, |
51 ClockMenuButton** clock_button); | |
stevenjb
2011/11/18 21:18:29
This seems a bit awkward to me. What do you think
sky
2011/11/18 21:23:24
I went this route because of type safety. GetViewB
stevenjb
2011/11/18 23:04:48
That's fair. Part of me wonders whether we should
| |
47 | 52 |
48 private: | 53 private: |
49 void UpdateClockText(); | 54 void UpdateClockText(); |
50 | 55 |
51 DISALLOW_COPY_AND_ASSIGN(StatusAreaViewChromeos); | 56 DISALLOW_COPY_AND_ASSIGN(StatusAreaViewChromeos); |
52 }; | 57 }; |
53 | 58 |
54 } // namespace chromeos | 59 } // namespace chromeos |
55 | 60 |
56 #endif // CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_VIEW_CHROMEOS_H_ | 61 #endif // CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_VIEW_CHROMEOS_H_ |
OLD | NEW |