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

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

Issue 2513673004: Reland: chromeos: Convert ash VPNDelegate interface to mojo (Closed)
Patch Set: fix manifest for reland 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
« no previous file with comments | « chrome/browser/ui/ash/vpn_delegate_chromeos.cc ('k') | chrome/browser/ui/ash/vpn_list_forwarder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/vpn_list_forwarder.h
diff --git a/chrome/browser/ui/ash/vpn_delegate_chromeos.h b/chrome/browser/ui/ash/vpn_list_forwarder.h
similarity index 68%
rename from chrome/browser/ui/ash/vpn_delegate_chromeos.h
rename to chrome/browser/ui/ash/vpn_list_forwarder.h
index bd18557a448b539886a7e8430420a9743831fdc0..335b57103dda2bb2e37796d98344e8297acf28a7 100644
--- a/chrome/browser/ui/ash/vpn_delegate_chromeos.h
+++ b/chrome/browser/ui/ash/vpn_list_forwarder.h
@@ -2,12 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_UI_ASH_VPN_DELEGATE_CHROMEOS_H_
-#define CHROME_BROWSER_UI_ASH_VPN_DELEGATE_CHROMEOS_H_
+#ifndef CHROME_BROWSER_UI_ASH_VPN_LIST_FORWARDER_H_
+#define CHROME_BROWSER_UI_ASH_VPN_LIST_FORWARDER_H_
-#include <vector>
-
-#include "ash/common/system/chromeos/network/vpn_delegate.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/notification_observer.h"
@@ -18,17 +15,13 @@ namespace extensions {
class ExtensionRegistry;
}
-// Chrome OS implementation of a delegate that provides UI code in ash with
-// access to the VPN providers enabled in the primary user's profile.
-class VPNDelegateChromeOS : public ash::VPNDelegate,
- public extensions::ExtensionRegistryObserver,
- public content::NotificationObserver {
+// Forwards the list of extension-backed VPN providers in the primary user's
+// profile to ash over mojo.
+class VpnListForwarder : public extensions::ExtensionRegistryObserver,
+ public content::NotificationObserver {
public:
- VPNDelegateChromeOS();
- ~VPNDelegateChromeOS() override;
-
- // ash::VPNDelegate:
- void ShowAddPage(const std::string& extension_id) override;
+ VpnListForwarder();
+ ~VpnListForwarder() override;
// extensions::ExtensionRegistryObserver:
void OnExtensionLoaded(content::BrowserContext* browser_context,
@@ -56,14 +49,17 @@ class VPNDelegateChromeOS : public ash::VPNDelegate,
// initial list. Must only be called when a user is logged in.
void AttachToPrimaryUserExtensionRegistry();
+ // Whether this object has ever sent a third-party provider list to ash.
+ bool sent_providers_ = false;
+
// The primary user's extension registry, if a user is logged in.
extensions::ExtensionRegistry* extension_registry_ = nullptr;
content::NotificationRegistrar registrar_;
- base::WeakPtrFactory<VPNDelegateChromeOS> weak_factory_;
+ base::WeakPtrFactory<VpnListForwarder> weak_factory_;
- DISALLOW_COPY_AND_ASSIGN(VPNDelegateChromeOS);
+ DISALLOW_COPY_AND_ASSIGN(VpnListForwarder);
};
-#endif // CHROME_BROWSER_UI_ASH_VPN_DELEGATE_CHROMEOS_H_
+#endif // CHROME_BROWSER_UI_ASH_VPN_LIST_FORWARDER_H_
« no previous file with comments | « chrome/browser/ui/ash/vpn_delegate_chromeos.cc ('k') | chrome/browser/ui/ash/vpn_list_forwarder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698