#include "base/prefs/pref_service.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/net/proxy_config_handler.h"
-#include "chrome/browser/policy/browser_policy_connector.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
+#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/prefs/proxy_config_dictionary.h"
#include "chrome/browser/prefs/proxy_prefs.h"
#include "chrome/common/pref_names.h"
-#include "chromeos/network/favorite_state.h"
#include "chromeos/network/network_profile.h"
#include "chromeos/network/network_profile_handler.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
#include "chromeos/network/onc/onc_utils.h"
+#include "components/policy/core/common/cloud/cloud_policy_constants.h"
+#include "components/user_manager/user_manager.h"
namespace chromeos {
// proxy was configured for this network.
bool GetProxyConfig(const PrefService* profile_prefs,
const PrefService* local_state_prefs,
- const FavoriteState& network,
+ const NetworkState& network,
net::ProxyConfig* proxy_config,
::onc::ONCSource* onc_source) {
scoped_ptr<ProxyConfigDictionary> proxy_dict =
- proxy_config::GetProxyConfigForFavoriteNetwork(
+ proxy_config::GetProxyConfigForNetwork(
profile_prefs, local_state_prefs, network, onc_source);
if (!proxy_dict)
return false;
const NetworkProfile* profile = NetworkHandler::Get()
->network_profile_handler()->GetProfileForPath(network_profile_path);
if (!profile) {
- LOG(WARNING) << "Unknown profile_path '" << network_profile_path
- << "'. Ignoring proxy.";
+ VLOG(1) << "Unknown profile_path '" << network_profile_path
+ << "'. Ignoring proxy.";
return true;
}
if (profile->type() == NetworkProfile::TYPE_USER) {
return false;
}
if (onc_source == ::onc::ONC_SOURCE_DEVICE_POLICY) {
- policy::BrowserPolicyConnector* connector =
- g_browser_process->browser_policy_connector();
- const User* logged_in_user = UserManager::Get()->GetLoggedInUser();
+ policy::BrowserPolicyConnectorChromeOS* connector =
+ g_browser_process->platform_part()->browser_policy_connector_chromeos();
+ const user_manager::User* logged_in_user =
+ user_manager::UserManager::Get()->GetLoggedInUser();
if (connector->GetUserAffiliation(logged_in_user->email()) ==
policy::USER_AFFILIATION_MANAGED) {
VLOG(1) << "Respecting proxy for network, as logged-in user belongs to "
void ProxyConfigServiceImpl::DetermineEffectiveConfigFromDefaultNetwork() {
NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
- const FavoriteState* network = handler->DefaultFavoriteNetwork();
+ const NetworkState* network = handler->DefaultNetwork();
// Get prefs proxy config if available.
net::ProxyConfig pref_config;