Home | History | Annotate | Download | only in chromeos
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_CHROMEOS_NETWORK_LOGIN_OBSERVER_H_
      6 #define CHROME_BROWSER_CHROMEOS_NETWORK_LOGIN_OBSERVER_H_
      7 #pragma once
      8 
      9 #include <map>
     10 #include <string>
     11 
     12 #include "base/basictypes.h"
     13 #include "chrome/browser/chromeos/cros/network_library.h"
     14 
     15 namespace views {
     16 class WindowDelegate;
     17 }
     18 
     19 namespace chromeos {
     20 
     21 // The network login observer reshows a login dialog if there was an error.
     22 
     23 class NetworkLoginObserver : public NetworkLibrary::NetworkManagerObserver {
     24  public:
     25   explicit NetworkLoginObserver(NetworkLibrary* netlib);
     26   virtual ~NetworkLoginObserver();
     27 
     28   typedef std::map<std::string, bool> NetworkFailureMap;
     29  private:
     30   virtual void CreateModalPopup(views::WindowDelegate* view);
     31 
     32   virtual void RefreshStoredNetworks(const WifiNetworkVector& wifi_networks,
     33                                      const VirtualNetworkVector& vpn_networks);
     34 
     35   // NetworkLibrary::NetworkManagerObserver implementation.
     36   virtual void OnNetworkManagerChanged(NetworkLibrary* obj);
     37 
     38   // Wifi networks by service path mapped to if it failed previously.
     39   NetworkFailureMap network_failures_;
     40 
     41   DISALLOW_COPY_AND_ASSIGN(NetworkLoginObserver);
     42 };
     43 
     44 }  // namespace chromeos
     45 
     46 #endif  // CHROME_BROWSER_CHROMEOS_NETWORK_LOGIN_OBSERVER_H_
     47