| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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_ASH_SYSTEM_TRAY_DELEGATE_COMMON_H_ | |
| 6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_COMMON_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "ash/system/tray/system_tray_delegate.h" | |
| 12 #include "base/compiler_specific.h" | |
| 13 #include "base/i18n/time_formatting.h" | |
| 14 #include "base/macros.h" | |
| 15 #include "content/public/browser/notification_observer.h" | |
| 16 #include "content/public/browser/notification_registrar.h" | |
| 17 | |
| 18 // Common base class for platform-specific implementations. | |
| 19 class SystemTrayDelegateCommon : public ash::SystemTrayDelegate, | |
| 20 public content::NotificationObserver { | |
| 21 public: | |
| 22 SystemTrayDelegateCommon(); | |
| 23 | |
| 24 ~SystemTrayDelegateCommon() override; | |
| 25 | |
| 26 // Overridden from ash::SystemTrayDelegate: | |
| 27 void Initialize() override; | |
| 28 void Shutdown() override; | |
| 29 bool GetTrayVisibilityOnStartup() override; | |
| 30 ash::user::LoginStatus GetUserLoginStatus() const override; | |
| 31 bool IsUserSupervised() const override; | |
| 32 bool IsUserChild() const override; | |
| 33 void GetSystemUpdateInfo(ash::UpdateInfo* info) const override; | |
| 34 base::HourClockType GetHourClockType() const override; | |
| 35 void ShowChromeSlow() override; | |
| 36 void ShowHelp() override; | |
| 37 void RequestRestartForUpdate() override; | |
| 38 int GetSystemTrayMenuWidth() override; | |
| 39 | |
| 40 private: | |
| 41 void UpdateClockType(); | |
| 42 | |
| 43 // content::NotificationObserver implementation. | |
| 44 void Observe(int type, | |
| 45 const content::NotificationSource& source, | |
| 46 const content::NotificationDetails& details) override; | |
| 47 | |
| 48 std::unique_ptr<content::NotificationRegistrar> registrar_; | |
| 49 base::HourClockType clock_type_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateCommon); | |
| 52 }; | |
| 53 | |
| 54 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_COMMON_H_ | |
| OLD | NEW |