| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 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 ASH_SYSTEM_NETWORK_NETWORK_OBSERVER_H | |
| 6 #define ASH_SYSTEM_NETWORK_NETWORK_OBSERVER_H | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/string16.h" | |
| 11 | |
| 12 namespace ash { | |
| 13 | |
| 14 struct NetworkIconInfo; | |
| 15 | |
| 16 class NetworkTrayDelegate { | |
| 17 public: | |
| 18 virtual ~NetworkTrayDelegate() {} | |
| 19 | |
| 20 // Notifies that the |index|-th link on the notification is clicked. | |
| 21 virtual void NotificationLinkClicked(size_t index) = 0; | |
| 22 }; | |
| 23 | |
| 24 class NetworkObserver { | |
| 25 public: | |
| 26 enum MessageType { | |
| 27 // Priority order, highest to lowest. | |
| 28 ERROR_CONNECT_FAILED, | |
| 29 | |
| 30 MESSAGE_DATA_NONE, | |
| 31 MESSAGE_DATA_LOW, | |
| 32 MESSAGE_DATA_PROMO, | |
| 33 }; | |
| 34 | |
| 35 virtual ~NetworkObserver() {} | |
| 36 | |
| 37 virtual void OnNetworkRefresh(const NetworkIconInfo& info) = 0; | |
| 38 | |
| 39 // Sets a network message notification. |message_type| identifies the type of | |
| 40 // message. |delegate|->NotificationLinkClicked() will be called if any of the | |
| 41 // |links| are clicked (if supplied, |links| may be empty). | |
| 42 virtual void SetNetworkMessage(NetworkTrayDelegate* delegate, | |
| 43 MessageType message_type, | |
| 44 const string16& title, | |
| 45 const string16& message, | |
| 46 const std::vector<string16>& links) = 0; | |
| 47 // Clears the message notification for |message_type|. | |
| 48 virtual void ClearNetworkMessage(MessageType message_type) = 0; | |
| 49 | |
| 50 // Called when the user attempted to toggle Wi-Fi enable/disable. | |
| 51 // NOTE: Toggling is asynchronous and subsequent calls to query the current | |
| 52 // state may return the old value. | |
| 53 virtual void OnWillToggleWifi() = 0; | |
| 54 }; | |
| 55 | |
| 56 } // namespace ash | |
| 57 | |
| 58 #endif // ASH_SYSTEM_NETWORK_NETWORK_OBSERVER_H | |
| OLD | NEW |