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

Unified Diff: ash/common/system/tray/system_tray_controller.h

Issue 2525813004: chromeos: Introduce SetClient() on ash::mojom::SystemTray interface (Closed)
Patch Set: Created 4 years, 1 month 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: ash/common/system/tray/system_tray_controller.h
diff --git a/ash/common/system/tray/system_tray_controller.h b/ash/common/system/tray/system_tray_controller.h
index 2cfb8bf87985498753d88d23c62e37d78db7ee8e..9abe99a68ce7131c04f6665a2e86667dca7f0791 100644
--- a/ash/common/system/tray/system_tray_controller.h
+++ b/ash/common/system/tray/system_tray_controller.h
@@ -12,29 +12,21 @@
#include "base/macros.h"
#include "mojo/public/cpp/bindings/binding_set.h"
-namespace service_manager {
-class Connector;
-}
-
namespace ash {
// Both implements mojom::SystemTray and wraps the mojom::SystemTrayClient
-// interface. The wrapper makes the initial connection and handles reconnecting
-// on error. Implements both because it caches state pushed down from the
+// interface. Implements both because it caches state pushed down from the
// browser process via SystemTray so it can be synchronously queried inside ash.
//
// Conceptually similar to historical ash-to-chrome interfaces like
// SystemTrayDelegate. Lives on the main thread.
//
-// Only connects to the actual mojom::SystemTrayClient interface when running on
-// Chrome OS. In tests and on Windows all operations are no-ops.
-//
// TODO: Consider renaming this to SystemTrayClient or renaming the current
// SystemTray to SystemTrayView and making this class SystemTray.
class ASH_EXPORT SystemTrayController
: NON_EXPORTED_BASE(public mojom::SystemTray) {
public:
- explicit SystemTrayController(service_manager::Connector* connector);
+ SystemTrayController();
~SystemTrayController() override;
base::HourClockType hour_clock_type() const { return hour_clock_type_; }
@@ -64,19 +56,14 @@ class ASH_EXPORT SystemTrayController
void BindRequest(mojom::SystemTrayRequest request);
private:
- // Connects or reconnects to the mojom::SystemTrayClient interface when
- // running on Chrome OS. Otherwise does nothing. Returns true if connected.
- bool ConnectToSystemTrayClient();
-
- // Handles errors on the |system_tray_client_| interface connection.
- void OnClientConnectionError();
+ // Returns true if |system_tray_client_| is bound. Otherwise logs an error and
+ // returns false.
+ bool HasSystemTrayClient();
// mojom::SystemTray:
+ void SetClient(mojom::SystemTrayClientPtr client) override;
void SetUse24HourClock(bool use_24_hour) override;
- // May be null in unit tests.
- service_manager::Connector* connector_;
-
// Client interface in chrome browser. Only bound on Chrome OS.
mojom::SystemTrayClientPtr system_tray_client_;
« no previous file with comments | « no previous file | ash/common/system/tray/system_tray_controller.cc » ('j') | ash/common/system/tray/system_tray_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698