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

Side by Side Diff: chrome/browser/ui/ash/vpn_delegate_chromeos.h

Issue 2510083006: chromeos: Move ownership of ash VPN provider list from chrome into ash (Closed)
Patch Set: Collapse VPNProvider::Key and VPNProvider structs 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_ASH_VPN_DELEGATE_CHROMEOS_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_VPN_DELEGATE_CHROMEOS_H_
6 #define CHROME_BROWSER_UI_ASH_VPN_DELEGATE_CHROMEOS_H_ 6 #define CHROME_BROWSER_UI_ASH_VPN_DELEGATE_CHROMEOS_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/system/chromeos/network/vpn_delegate.h" 10 #include "ash/common/system/chromeos/network/vpn_delegate.h"
(...skipping 10 matching lines...) Expand all
21 // Chrome OS implementation of a delegate that provides UI code in ash with 21 // Chrome OS implementation of a delegate that provides UI code in ash with
22 // access to the VPN providers enabled in the primary user's profile. 22 // access to the VPN providers enabled in the primary user's profile.
23 class VPNDelegateChromeOS : public ash::VPNDelegate, 23 class VPNDelegateChromeOS : public ash::VPNDelegate,
24 public extensions::ExtensionRegistryObserver, 24 public extensions::ExtensionRegistryObserver,
25 public content::NotificationObserver { 25 public content::NotificationObserver {
26 public: 26 public:
27 VPNDelegateChromeOS(); 27 VPNDelegateChromeOS();
28 ~VPNDelegateChromeOS() override; 28 ~VPNDelegateChromeOS() override;
29 29
30 // ash::VPNDelegate: 30 // ash::VPNDelegate:
31 bool HaveThirdPartyVPNProviders() const override; 31 void ShowAddPage(const std::string& extension_id) override;
32 const std::vector<ash::VPNProvider>& GetVPNProviders() const override;
33 void ShowAddPage(const ash::VPNProvider::Key& key) override;
34 32
35 // extensions::ExtensionRegistryObserver: 33 // extensions::ExtensionRegistryObserver:
36 void OnExtensionLoaded(content::BrowserContext* browser_context, 34 void OnExtensionLoaded(content::BrowserContext* browser_context,
37 const extensions::Extension* extension) override; 35 const extensions::Extension* extension) override;
38 void OnExtensionUnloaded( 36 void OnExtensionUnloaded(
39 content::BrowserContext* browser_context, 37 content::BrowserContext* browser_context,
40 const extensions::Extension* extension, 38 const extensions::Extension* extension,
41 extensions::UnloadedExtensionInfo::Reason reason) override; 39 extensions::UnloadedExtensionInfo::Reason reason) override;
42 void OnShutdown(extensions::ExtensionRegistry* registry) override; 40 void OnShutdown(extensions::ExtensionRegistry* registry) override;
43 41
(...skipping 10 matching lines...) Expand all
54 void UpdateVPNProviders(); 52 void UpdateVPNProviders();
55 53
56 // Starts observing the primary user's extension registry to detect changes to 54 // Starts observing the primary user's extension registry to detect changes to
57 // the list of VPN providers enabled in the user's profile and caches the 55 // the list of VPN providers enabled in the user's profile and caches the
58 // initial list. Must only be called when a user is logged in. 56 // initial list. Must only be called when a user is logged in.
59 void AttachToPrimaryUserExtensionRegistry(); 57 void AttachToPrimaryUserExtensionRegistry();
60 58
61 // The primary user's extension registry, if a user is logged in. 59 // The primary user's extension registry, if a user is logged in.
62 extensions::ExtensionRegistry* extension_registry_ = nullptr; 60 extensions::ExtensionRegistry* extension_registry_ = nullptr;
63 61
64 // A cache of the VPN providers enabled in the primary user's profile.
65 std::vector<ash::VPNProvider> vpn_providers_;
66
67 content::NotificationRegistrar registrar_; 62 content::NotificationRegistrar registrar_;
68 63
69 base::WeakPtrFactory<VPNDelegateChromeOS> weak_factory_; 64 base::WeakPtrFactory<VPNDelegateChromeOS> weak_factory_;
70 65
71 DISALLOW_COPY_AND_ASSIGN(VPNDelegateChromeOS); 66 DISALLOW_COPY_AND_ASSIGN(VPNDelegateChromeOS);
72 }; 67 };
73 68
74 #endif // CHROME_BROWSER_UI_ASH_VPN_DELEGATE_CHROMEOS_H_ 69 #endif // CHROME_BROWSER_UI_ASH_VPN_DELEGATE_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698