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

Side by Side Diff: chrome/browser/chromeos/cros/network_library.cc

Issue 6027012: Fix so that login errors are shown from login/oobe screens.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/cros/network_library.h" 5 #include "chrome/browser/chromeos/cros/network_library.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
11 #include "base/i18n/time_formatting.h" 11 #include "base/i18n/time_formatting.h"
12 #include "base/stl_util-inl.h" 12 #include "base/stl_util-inl.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/utf_string_conversions.h" 15 #include "base/utf_string_conversions.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "chrome/browser/browser_thread.h" 17 #include "chrome/browser/browser_thread.h"
18 #include "chrome/browser/chromeos/network_login_observer.h"
18 #include "chrome/browser/chromeos/cros/cros_library.h" 19 #include "chrome/browser/chromeos/cros/cros_library.h"
19 #include "chrome/browser/chromeos/login/user_manager.h" 20 #include "chrome/browser/chromeos/login/user_manager.h"
20 #include "chrome/common/time_format.h" 21 #include "chrome/common/time_format.h"
21 #include "grit/generated_resources.h" 22 #include "grit/generated_resources.h"
22 23
23 namespace { 24 namespace {
24 25
25 // FlimFlam may send multiple notifications for single network change. 26 // FlimFlam may send multiple notifications for single network change.
26 // We wait small amount of time before retrieving the status to 27 // We wait small amount of time before retrieving the status to
27 // avoid send multiple sync request to flim flam. 28 // avoid send multiple sync request to flim flam.
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 wifi_scanning_(false), 840 wifi_scanning_(false),
840 offline_mode_(false), 841 offline_mode_(false),
841 update_task_(NULL) { 842 update_task_(NULL) {
842 if (EnsureCrosLoaded()) { 843 if (EnsureCrosLoaded()) {
843 Init(); 844 Init();
844 network_manager_monitor_ = 845 network_manager_monitor_ =
845 MonitorNetworkManager(&NetworkManagerStatusChangedHandler, 846 MonitorNetworkManager(&NetworkManagerStatusChangedHandler,
846 this); 847 this);
847 data_plan_monitor_ = MonitorCellularDataPlan(&DataPlanUpdateHandler, 848 data_plan_monitor_ = MonitorCellularDataPlan(&DataPlanUpdateHandler,
848 this); 849 this);
850 network_login_observer_ = new NetworkLoginObserver(this);
849 } else { 851 } else {
850 InitTestData(); 852 InitTestData();
851 } 853 }
852 } 854 }
853 855
854 ~NetworkLibraryImpl() { 856 ~NetworkLibraryImpl() {
857 if (network_login_observer_)
858 delete network_login_observer_;
859 network_login_observer_ = NULL;
855 network_manager_observers_.Clear(); 860 network_manager_observers_.Clear();
856 if (network_manager_monitor_) 861 if (network_manager_monitor_)
857 DisconnectPropertyChangeMonitor(network_manager_monitor_); 862 DisconnectPropertyChangeMonitor(network_manager_monitor_);
858 data_plan_observers_.Clear(); 863 data_plan_observers_.Clear();
859 if (data_plan_monitor_) 864 if (data_plan_monitor_)
860 DisconnectDataPlanUpdateMonitor(data_plan_monitor_); 865 DisconnectDataPlanUpdateMonitor(data_plan_monitor_);
861 STLDeleteValues(&network_observers_); 866 STLDeleteValues(&network_observers_);
862 ClearNetworks(); 867 ClearNetworks();
863 } 868 }
864 869
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
1853 1858
1854 // Network observer map 1859 // Network observer map
1855 NetworkObserverMap network_observers_; 1860 NetworkObserverMap network_observers_;
1856 1861
1857 // For monitoring network manager status changes. 1862 // For monitoring network manager status changes.
1858 PropertyChangeMonitor network_manager_monitor_; 1863 PropertyChangeMonitor network_manager_monitor_;
1859 1864
1860 // For monitoring data plan changes to the connected cellular network. 1865 // For monitoring data plan changes to the connected cellular network.
1861 DataPlanUpdateMonitor data_plan_monitor_; 1866 DataPlanUpdateMonitor data_plan_monitor_;
1862 1867
1868 // Network login observer.
1869 NetworkLoginObserver* network_login_observer_;
stevenjb 2011/01/11 20:53:52 Maybe use scoped_ptr<NetworkLoginObserver>?
Charlie Lee 2011/01/11 22:52:06 Done.
1870
1863 // The ethernet network. 1871 // The ethernet network.
1864 EthernetNetwork* ethernet_; 1872 EthernetNetwork* ethernet_;
1865 1873
1866 // The list of available wifi networks. 1874 // The list of available wifi networks.
1867 WifiNetworkVector wifi_networks_; 1875 WifiNetworkVector wifi_networks_;
1868 1876
1869 // The current connected (or connecting) wifi network. 1877 // The current connected (or connecting) wifi network.
1870 WifiNetwork* wifi_; 1878 WifiNetwork* wifi_;
1871 1879
1872 // The remembered wifi networks. 1880 // The remembered wifi networks.
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
2018 return new NetworkLibraryStubImpl(); 2026 return new NetworkLibraryStubImpl();
2019 else 2027 else
2020 return new NetworkLibraryImpl(); 2028 return new NetworkLibraryImpl();
2021 } 2029 }
2022 2030
2023 } // namespace chromeos 2031 } // namespace chromeos
2024 2032
2025 // Allows InvokeLater without adding refcounting. This class is a Singleton and 2033 // Allows InvokeLater without adding refcounting. This class is a Singleton and
2026 // won't be deleted until it's last InvokeLater is run. 2034 // won't be deleted until it's last InvokeLater is run.
2027 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImpl); 2035 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::NetworkLibraryImpl);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/background_view.h » ('j') | chrome/browser/chromeos/network_login_observer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698