Add an --enable-container-culling commandline flag.
[chromium-blink-merge.git] / chrome / browser / chromeos / ui_proxy_config_service.h
blob44c1da833c6ec3b5ee7f31d3764185a3f68a9330
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_SERVICE_H_
6 #define CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_SERVICE_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "chrome/browser/chromeos/ui_proxy_config.h"
13 class PrefService;
15 namespace chromeos {
17 class FavoriteState;
19 // This class is only accessed from the UI via Profile::GetProxyConfigTracker to
20 // allow the user to read and modify the proxy configuration via
21 // GetProxyConfig and SetProxyConfig.
23 // Before reading/setting a proxy config, a network has to be selected using
24 // either SetCurrentNetwork (any remembered network) or
25 // MakeActiveNetworkCurrent.
26 class UIProxyConfigService {
27 public:
28 UIProxyConfigService();
29 ~UIProxyConfigService();
31 // After this call, proxy settings are read from |profile_prefs| and
32 // |local_state_prefs|. In case of usage for the sign-in screen,
33 // |profile_prefs| must be NULL because sign-in screen should depend only on
34 // shared settings.
35 void SetPrefs(PrefService* profile_prefs, PrefService* local_state_prefs);
37 // Called by UI to set the network with service path |current_network| to be
38 // displayed or edited. Subsequent Set*/Get* methods will use this
39 // network, until this method is called again.
40 void SetCurrentNetwork(const std::string& current_network);
42 void UpdateFromPrefs();
44 // Called from UI to retrieve the stored proxy configuration, which is either
45 // the last proxy config of the current network or the one last set by
46 // SetProxyConfig.
47 void GetProxyConfig(UIProxyConfig* config) const;
49 // Called from UI to update proxy configuration for different modes. Stores
50 // and persists |config| to shill for the current network.
51 void SetProxyConfig(const UIProxyConfig& config);
53 private:
54 // Determines effective proxy config based on prefs from config tracker,
55 // |network| and if user is using shared proxies. The effective config is
56 // stored in |current_ui_config_| but not activated on network stack, and
57 // hence, not picked up by observers.
58 void DetermineEffectiveConfig(const FavoriteState& network);
60 // Service path of network whose proxy configuration is being displayed or
61 // edited via UI.
62 std::string current_ui_network_;
64 // Proxy configuration of |current_ui_network_|.
65 UIProxyConfig current_ui_config_;
67 bool signin_screen_;
69 // Not owned.
70 PrefService* profile_prefs_;
72 // Not owned.
73 PrefService* local_state_prefs_;
75 DISALLOW_COPY_AND_ASSIGN(UIProxyConfigService);
78 } // namespace chromeos
80 #endif // CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_SERVICE_H_