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

Side by Side Diff: chrome/browser/chromeos/arc/arc_settings_service.cc

Issue 2436753002: Removed ONC check in ArcSettingsService. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_settings_service_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/chromeos/arc/arc_settings_service.h" 5 #include "chrome/browser/chromeos/arc/arc_settings_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/gtest_prod_util.h" 9 #include "base/gtest_prod_util.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 bool write_success = base::JSONWriter::Write(extras, &extras_json); 467 bool write_success = base::JSONWriter::Write(extras, &extras_json);
468 DCHECK(write_success); 468 DCHECK(write_success);
469 469
470 instance->SendBroadcast(action, "org.chromium.arc.intent_helper", 470 instance->SendBroadcast(action, "org.chromium.arc.intent_helper",
471 "org.chromium.arc.intent_helper.SettingsReceiver", 471 "org.chromium.arc.intent_helper.SettingsReceiver",
472 extras_json); 472 extras_json);
473 } 473 }
474 474
475 void ArcSettingsServiceImpl::DefaultNetworkChanged( 475 void ArcSettingsServiceImpl::DefaultNetworkChanged(
476 const chromeos::NetworkState* network) { 476 const chromeos::NetworkState* network) {
477 // kProxy pref and ONC policy have more priority than the default network 477 // kProxy pref has more priority than the default network update.
478 // update. 478 // If a default network is changed to the network with ONC policy with proxy
479 Profile* profile = ProfileManager::GetActiveUserProfile(); 479 // settings, it should be translated here.
480 if (network && !IsPrefProxyConfigApplied() && 480 if (network && !IsPrefProxyConfigApplied())
481 !chromeos::onc::HasPolicyForNetwork(
482 profile->GetPrefs(), g_browser_process->local_state(), *network)) {
483 SyncProxySettings(); 481 SyncProxySettings();
484 }
485 } 482 }
486 483
487 ArcSettingsService::ArcSettingsService(ArcBridgeService* bridge_service) 484 ArcSettingsService::ArcSettingsService(ArcBridgeService* bridge_service)
488 : ArcService(bridge_service) { 485 : ArcService(bridge_service) {
489 arc_bridge_service()->intent_helper()->AddObserver(this); 486 arc_bridge_service()->intent_helper()->AddObserver(this);
490 } 487 }
491 488
492 ArcSettingsService::~ArcSettingsService() { 489 ArcSettingsService::~ArcSettingsService() {
493 arc_bridge_service()->intent_helper()->RemoveObserver(this); 490 arc_bridge_service()->intent_helper()->RemoveObserver(this);
494 } 491 }
495 492
496 void ArcSettingsService::OnInstanceReady() { 493 void ArcSettingsService::OnInstanceReady() {
497 impl_.reset(new ArcSettingsServiceImpl(arc_bridge_service())); 494 impl_.reset(new ArcSettingsServiceImpl(arc_bridge_service()));
498 } 495 }
499 496
500 void ArcSettingsService::OnInstanceClosed() { 497 void ArcSettingsService::OnInstanceClosed() {
501 impl_.reset(); 498 impl_.reset();
502 } 499 }
503 500
504 } // namespace arc 501 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_settings_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698