Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: chrome/browser/ui/ash/system_tray_delegate_common.h

Issue 636853002: Common code from linux and windows implementations of SystemTrayDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/system_tray_delegate_common.h
diff --git a/ash/system/tray/default_system_tray_delegate.h b/chrome/browser/ui/ash/system_tray_delegate_common.h
similarity index 64%
copy from ash/system/tray/default_system_tray_delegate.h
copy to chrome/browser/ui/ash/system_tray_delegate_common.h
index 72d1c401b2bd13f0794dfd9bcdd1c0e8539a11f9..42a79acd201edcb1512c7bec13dca6991b337b50 100644
--- a/ash/system/tray/default_system_tray_delegate.h
+++ b/chrome/browser/ui/ash/system_tray_delegate_common.h
@@ -1,27 +1,37 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ASH_SYSTEM_TRAY_DEFAULT_SYSTEM_TRAY_DELEGATE_H_
-#define ASH_SYSTEM_TRAY_DEFAULT_SYSTEM_TRAY_DELEGATE_H_
+#ifndef CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_COMMON_H_
+#define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_COMMON_H_
+
+#include <string>
-#include "ash/ash_export.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "base/compiler_specific.h"
+#include "base/i18n/time_formatting.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
namespace ash {
+class SystemTrayNotifier;
+}
-class ASH_EXPORT DefaultSystemTrayDelegate : public SystemTrayDelegate {
+// Common base class for platform-specific implementations.
+class SystemTrayDelegateCommon : public ash::SystemTrayDelegate,
+ public content::NotificationObserver {
public:
- DefaultSystemTrayDelegate();
- virtual ~DefaultSystemTrayDelegate();
+ SystemTrayDelegateCommon();
+
+ virtual ~SystemTrayDelegateCommon();
- // Overridden from SystemTrayDelegate:
+ // Overridden from ash::SystemTrayDelegate:
virtual void Initialize() override;
virtual void Shutdown() override;
virtual bool GetTrayVisibilityOnStartup() override;
- virtual user::LoginStatus GetUserLoginStatus() const override;
+ virtual ash::user::LoginStatus GetUserLoginStatus() const override;
virtual void ChangeProfilePicture() override;
virtual const std::string GetEnterpriseDomain() const override;
virtual const base::string16 GetEnterpriseMessage() const override;
@@ -29,7 +39,7 @@ class ASH_EXPORT DefaultSystemTrayDelegate : public SystemTrayDelegate {
virtual const base::string16 GetSupervisedUserManagerName() const override;
virtual const base::string16 GetSupervisedUserMessage() const override;
virtual bool IsUserSupervised() const override;
- virtual void GetSystemUpdateInfo(UpdateInfo* info) const override;
+ virtual void GetSystemUpdateInfo(ash::UpdateInfo* info) const override;
virtual base::HourClockType GetHourClockType() const override;
virtual void ShowSettings() override;
virtual bool ShouldShowSettings() override;
@@ -45,8 +55,8 @@ class ASH_EXPORT DefaultSystemTrayDelegate : public SystemTrayDelegate {
virtual void ShowAccessibilityHelp() override;
virtual void ShowAccessibilitySettings() override;
virtual void ShowPublicAccountInfo() override;
- virtual void ShowEnterpriseInfo() override;
virtual void ShowSupervisedUserInfo() override;
+ virtual void ShowEnterpriseInfo() override;
virtual void ShowUserLogin() override;
virtual bool ShowSpringChargerReplacementDialog() override;
virtual bool IsSpringChargerReplacementDialogVisible() override;
@@ -55,20 +65,21 @@ class ASH_EXPORT DefaultSystemTrayDelegate : public SystemTrayDelegate {
virtual void SignOut() override;
virtual void RequestLockScreen() override;
virtual void RequestRestartForUpdate() override;
- virtual void GetAvailableBluetoothDevices(BluetoothDeviceList* list) override;
+ virtual void GetAvailableBluetoothDevices(
+ ash::BluetoothDeviceList* list) override;
virtual void BluetoothStartDiscovering() override;
virtual void BluetoothStopDiscovering() override;
virtual void ConnectToBluetoothDevice(const std::string& address) override;
- virtual void GetCurrentIME(IMEInfo* info) override;
- virtual void GetAvailableIMEList(IMEInfoList* list) override;
- virtual void GetCurrentIMEProperties(IMEPropertyInfoList* list) override;
+ virtual bool IsBluetoothDiscovering() override;
+ virtual void GetCurrentIME(ash::IMEInfo* info) override;
+ virtual void GetAvailableIMEList(ash::IMEInfoList* list) override;
+ virtual void GetCurrentIMEProperties(ash::IMEPropertyInfoList* list) override;
virtual void SwitchIME(const std::string& ime_id) override;
virtual void ActivateIMEProperty(const std::string& key) override;
virtual void ShowNetworkConfigure(const std::string& network_id) override;
virtual bool EnrollNetwork(const std::string& network_id) override;
virtual void ManageBluetoothDevices() override;
virtual void ToggleBluetooth() override;
- virtual bool IsBluetoothDiscovering() override;
virtual void ShowMobileSimDialog() override;
virtual void ShowMobileSetupDialog(const std::string& service_path) override;
virtual void ShowOtherNetworkDialog(const std::string& type) override;
@@ -76,9 +87,9 @@ class ASH_EXPORT DefaultSystemTrayDelegate : public SystemTrayDelegate {
virtual bool GetBluetoothEnabled() override;
virtual bool GetBluetoothDiscovering() override;
virtual void ChangeProxySettings() override;
- virtual VolumeControlDelegate* GetVolumeControlDelegate() const override;
+ virtual ash::VolumeControlDelegate* GetVolumeControlDelegate() const override;
virtual void SetVolumeControlDelegate(
- scoped_ptr<VolumeControlDelegate> delegate) override;
+ scoped_ptr<ash::VolumeControlDelegate> delegate) override;
virtual bool GetSessionStartTime(
base::TimeTicks* session_start_time) override;
virtual bool GetSessionLengthLimit(
@@ -86,20 +97,27 @@ class ASH_EXPORT DefaultSystemTrayDelegate : public SystemTrayDelegate {
virtual int GetSystemTrayMenuWidth() override;
virtual void ActiveUserWasChanged() override;
virtual bool IsSearchKeyMappedToCapsLock() override;
- virtual tray::UserAccountsDelegate* GetUserAccountsDelegate(
+ virtual ash::tray::UserAccountsDelegate* GetUserAccountsDelegate(
const std::string& user_id) override;
virtual void AddCustodianInfoTrayObserver(
- CustodianInfoTrayObserver* observer) override;
+ ash::CustodianInfoTrayObserver* observer) override;
virtual void RemoveCustodianInfoTrayObserver(
- CustodianInfoTrayObserver* observer) override;
+ ash::CustodianInfoTrayObserver* observer) override;
private:
- bool bluetooth_enabled_;
- scoped_ptr<VolumeControlDelegate> volume_control_delegate_;
+ ash::SystemTrayNotifier* GetSystemTrayNotifier();
- DISALLOW_COPY_AND_ASSIGN(DefaultSystemTrayDelegate);
-};
+ void UpdateClockType();
+
+ // content::NotificationObserver implementation.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) override;
-} // namespace ash
+ scoped_ptr<content::NotificationRegistrar> registrar_;
+ base::HourClockType clock_type_;
+
+ DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateCommon);
+};
-#endif // ASH_SYSTEM_TRAY_DEFAULT_SYSTEM_TRAY_DELEGATE_H_
+#endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_COMMON_H_
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate_views.cc ('k') | chrome/browser/ui/ash/system_tray_delegate_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698