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

Side by Side Diff: chrome/browser/chromeos/proxy_config_service_impl.cc

Issue 8467012: Refactor proxy handling for ChromeOS to not go through the CrosSettings interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Centralized the proxy change notification. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/proxy_config_service_impl.h" 5 #include "chrome/browser/chromeos/proxy_config_service_impl.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_value_serializer.h" 10 #include "base/json/json_value_serializer.h"
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 } 746 }
747 } 747 }
748 } else { // For UI, store effective proxy into |current_ui_config_|. 748 } else { // For UI, store effective proxy into |current_ui_config_|.
749 current_ui_config_.FromNetProxyConfig(effective_config); 749 current_ui_config_.FromNetProxyConfig(effective_config);
750 current_ui_config_.state = effective_config_state; 750 current_ui_config_.state = effective_config_state;
751 if (PrefPrecedes(effective_config_state)) 751 if (PrefPrecedes(effective_config_state))
752 current_ui_config_.user_modifiable = false; 752 current_ui_config_.user_modifiable = false;
753 else 753 else
754 current_ui_config_.user_modifiable = !network || !IgnoreProxy(network); 754 current_ui_config_.user_modifiable = !network || !IgnoreProxy(network);
755 } 755 }
756 // Notify whoever is interested in this change.
Mattias Nissler (ping if slow) 2011/11/08 09:25:22 I still think an actual observer or callback-based
757 content::NotificationService::current()->Notify(
758 chrome::NOTIFICATION_CURRENT_NETWORK_CHANGED,
759 content::NotificationService::AllSources(),
760 content::NotificationService::NoDetails());
kuan 2011/11/08 14:45:25 this is the wrong place to fire this notification;
756 } 761 }
757 762
758 void ProxyConfigServiceImpl::OnUISetCurrentNetwork(const Network* network) { 763 void ProxyConfigServiceImpl::OnUISetCurrentNetwork(const Network* network) {
759 DetermineEffectiveConfig(network, false); 764 DetermineEffectiveConfig(network, false);
760 VLOG(1) << this << ": current ui network: " 765 VLOG(1) << this << ": current ui network: "
761 << (network->name().empty() ? 766 << (network->name().empty() ?
762 current_ui_network_ : network->name()) 767 current_ui_network_ : network->name())
763 << ", " << ModeToString(current_ui_config_.mode) 768 << ", " << ModeToString(current_ui_config_.mode)
764 << ", " << ConfigStateToString(current_ui_config_.state) 769 << ", " << ConfigStateToString(current_ui_config_.state)
765 << ", modifiable:" << current_ui_config_.user_modifiable; 770 << ", modifiable:" << current_ui_config_.user_modifiable;
766 } 771 }
767 772
768 void ProxyConfigServiceImpl::ResetUICache() { 773 void ProxyConfigServiceImpl::ResetUICache() {
769 current_ui_network_.clear(); 774 current_ui_network_.clear();
770 current_ui_config_ = ProxyConfig(); 775 current_ui_config_ = ProxyConfig();
771 } 776 }
772 777
773 } // namespace chromeos 778 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698