Home | History | Annotate | Download | only in status
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_DROPDOWN_BUTTON_H_
      6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_DROPDOWN_BUTTON_H_
      7 #pragma once
      8 
      9 #include "chrome/browser/chromeos/cros/network_library.h"
     10 #include "chrome/browser/chromeos/status/network_menu.h"
     11 #include "chrome/browser/chromeos/views/dropdown_button.h"
     12 #include "ui/base/animation/animation_delegate.h"
     13 #include "ui/base/animation/throb_animation.h"
     14 
     15 namespace chromeos {
     16 
     17 // The network dropdown button with menu. Used on welcome screen.
     18 // This class will handle getting the networks to show connected network
     19 // at top level and populating the menu.
     20 // See NetworkMenu for more details.
     21 class NetworkDropdownButton : public DropDownButton,
     22                               public NetworkMenu,
     23                               public NetworkLibrary::NetworkManagerObserver {
     24  public:
     25   NetworkDropdownButton(bool browser_mode, gfx::NativeWindow parent_window);
     26   virtual ~NetworkDropdownButton();
     27 
     28   // ui::AnimationDelegate implementation.
     29   virtual void AnimationProgressed(const ui::Animation* animation);
     30 
     31   // NetworkLibrary::NetworkManagerObserver implementation.
     32   virtual void OnNetworkManagerChanged(NetworkLibrary* obj);
     33 
     34   // Refreshes button state. Used when language has been changed.
     35   void Refresh();
     36 
     37  protected:
     38   // NetworkMenu implementation:
     39   virtual bool IsBrowserMode() const { return browser_mode_; }
     40   virtual gfx::NativeWindow GetNativeWindow() const { return parent_window_; }
     41   virtual void OpenButtonOptions() {}
     42   virtual bool ShouldOpenButtonOptions() const { return false; }
     43 
     44  private:
     45   bool browser_mode_;
     46 
     47   // The throb animation that does the wifi connecting animation.
     48   ui::ThrobAnimation animation_connecting_;
     49 
     50   // The duration of the icon throbbing in milliseconds.
     51   static const int kThrobDuration;
     52 
     53   gfx::NativeWindow parent_window_;
     54 
     55   DISALLOW_COPY_AND_ASSIGN(NetworkDropdownButton);
     56 };
     57 
     58 }  // namespace chromeos
     59 
     60 #endif  // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_DROPDOWN_BUTTON_H_
     61