| 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_CHROMEOS_STATUS_STATUS_AREA_VIEW_CHROMEOS_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_VIEW_CHROMEOS_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "chrome/browser/chromeos/status/status_area_view.h" | |
| 10 | |
| 11 #include "chrome/browser/chromeos/system/timezone_settings.h" | |
| 12 #include "chrome/browser/chromeos/view_ids.h" | |
| 13 #include "chromeos/dbus/power_manager_client.h" | |
| 14 | |
| 15 class ClockMenuButton; | |
| 16 | |
| 17 namespace chromeos { | |
| 18 | |
| 19 class StatusAreaViewChromeos : public StatusAreaView, | |
| 20 public PowerManagerClient::Observer, | |
| 21 public system::TimezoneSettings::Observer { | |
| 22 public: | |
| 23 // The type of screen the host window is on. | |
| 24 enum ScreenMode { | |
| 25 LOGIN_MODE_WEBUI, // The host is for the WebUI OOBE/login screens. | |
| 26 BROWSER_MODE, // The host is for browser. | |
| 27 SCREEN_LOCKER_MODE, // The host is for screen locker. | |
| 28 }; | |
| 29 | |
| 30 // True if the browser is visible (i.e. not login/OOBE). | |
| 31 static bool IsBrowserMode(); | |
| 32 | |
| 33 // True if not logged in into user session (i.e. login/OOBE). | |
| 34 // It's not always !IsBrowserMode() as there's SCREEN_LOCKER_MODE which | |
| 35 // is inside user session, using login host and browser is not available. | |
| 36 static bool IsLoginMode(); | |
| 37 | |
| 38 // True if user is logged in but browser session is not available | |
| 39 // as screen lock is active. | |
| 40 static bool IsScreenLockMode(); | |
| 41 | |
| 42 // Sets current screen mode. | |
| 43 static void SetScreenMode(ScreenMode mode); | |
| 44 | |
| 45 explicit StatusAreaViewChromeos(); | |
| 46 virtual ~StatusAreaViewChromeos(); | |
| 47 | |
| 48 void Init(StatusAreaButton::Delegate* delegate); | |
| 49 | |
| 50 // PowerManagerClient::Observer: | |
| 51 virtual void SystemResumed() OVERRIDE; | |
| 52 | |
| 53 // TimezoneSettings::Observer: | |
| 54 virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE; | |
| 55 | |
| 56 // Convenience function to add buttons to a status area for ChromeOS. | |
| 57 // |clock_button| (if non-NULL) is set to the ClockMenuButton that is created | |
| 58 // by this method. | |
| 59 static void AddChromeosButtons(StatusAreaView* status_area, | |
| 60 StatusAreaButton::Delegate* delegate, | |
| 61 ClockMenuButton** clock_button); | |
| 62 | |
| 63 private: | |
| 64 // Current screen mode of the status area. | |
| 65 static ScreenMode screen_mode_; | |
| 66 | |
| 67 void UpdateClockText(); | |
| 68 | |
| 69 DISALLOW_COPY_AND_ASSIGN(StatusAreaViewChromeos); | |
| 70 }; | |
| 71 | |
| 72 } // namespace chromeos | |
| 73 | |
| 74 #endif // CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_VIEW_CHROMEOS_H_ | |
| OLD | NEW |