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