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

Unified Diff: ash/mus/system_tray_delegate_mus.cc

Issue 2378193002: mustash: Show networking items in ash system tray (Closed)
Patch Set: typo Created 4 years, 3 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: ash/mus/system_tray_delegate_mus.cc
diff --git a/ash/mus/system_tray_delegate_mus.cc b/ash/mus/system_tray_delegate_mus.cc
index 6d390b7d76efc4de6101525e521e78d73adbe2c7..7624d6fe40dc14a063918f6948051d8a1a05aca7 100644
--- a/ash/mus/system_tray_delegate_mus.cc
+++ b/ash/mus/system_tray_delegate_mus.cc
@@ -4,8 +4,10 @@
#include "ash/mus/system_tray_delegate_mus.h"
+#include "ash/common/system/networking_config_delegate.h"
#include "ash/common/system/tray/system_tray_notifier.h"
#include "ash/common/wm_shell.h"
+#include "ash/mus/vpn_delegate_mus.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/i18n/time_formatting.h"
@@ -17,10 +19,30 @@ namespace {
SystemTrayDelegateMus* g_instance = nullptr;
+// TODO(mash): Provide a real implementation, perhaps by folding its behavior
+// into an ash-side network information cache. http://crbug.com/651157
+class StubNetworkingConfigDelegate : public NetworkingConfigDelegate {
+ public:
+ StubNetworkingConfigDelegate() {}
+ ~StubNetworkingConfigDelegate() override {}
+
+ private:
+ // NetworkingConfigDelegate:
+ std::unique_ptr<const ExtensionInfo> LookUpExtensionForNetwork(
+ const std::string& service_path) override {
+ return nullptr;
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(StubNetworkingConfigDelegate);
+};
+
} // namespace
SystemTrayDelegateMus::SystemTrayDelegateMus(shell::Connector* connector)
- : connector_(connector), hour_clock_type_(base::GetHourClockType()) {
+ : connector_(connector),
+ hour_clock_type_(base::GetHourClockType()),
+ networking_config_delegate_(new StubNetworkingConfigDelegate),
+ vpn_delegate_(new VPNDelegateMus) {
// Don't make an initial connection to exe:chrome. Do it on demand.
DCHECK(!g_instance);
g_instance = this;
@@ -124,6 +146,15 @@ void SystemTrayDelegateMus::ShowProxySettings() {
ConnectToSystemTrayClient()->ShowProxySettings();
}
+NetworkingConfigDelegate* SystemTrayDelegateMus::GetNetworkingConfigDelegate()
+ const {
+ return networking_config_delegate_.get();
+}
+
+VPNDelegate* SystemTrayDelegateMus::GetVPNDelegate() const {
+ return vpn_delegate_.get();
+}
+
////////////////////////////////////////////////////////////////////////////////
// mojom::SystemTray:

Powered by Google App Engine
This is Rietveld 408576698