Commit f7710d36 authored by jochen@chromium.org's avatar jochen@chromium.org

Revert 181806

Speculative revert to see whether this broke browser_tests on Win Aura Tests(2)

A DCHECK() about invalid strings is hit

> Update NetworkStateListDetailedView, add network_icon::GetImageForTray
> 
> This integrates chanhes to the network list and icon code,
> and uses the Ash icon code in the network tray.
> 
> This completes the changes for:
> 161869:	Create NetworkStateHandler version of Ash network tray
> (Still behind a flag)
> 
> BUG=161869
> TBR=sky@chromium.org (for ash_strings)
> 
> Review URL: https://codereview.chromium.org/12221112

TBR=stevenjb@chromium.org
Review URL: https://codereview.chromium.org/12218116

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181896 0039d316-1c4b-4281-b951-d872f2087c98
parent 3ef89fc2
......@@ -338,9 +338,6 @@ Press Ctrl+Alt+Z to disable.
<message name="IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR" desc="Message for the status area when initializing the cellular device.">
Initializing cellular modem...
</message>
<message name="IDS_ASH_STATUS_TRAY_CELLULAR_SCANNING" desc="Message when scanning for cellular networks">
Searching for cellular networks...
</message>
<message name="IDS_ASH_STATUS_TRAY_SMS" desc="The label used in the status tray for SMS.">
SMS
</message>
......
This diff is collapsed.
......@@ -7,7 +7,6 @@
#include <string>
#include "base/string16.h"
#include "ui/gfx/image/image_skia.h"
namespace chromeos {
......@@ -19,30 +18,19 @@ namespace network_icon {
class AnimationObserver;
// Type of icon which dictates color theme and VPN badging
enum IconType {
ICON_TYPE_TRAY, // light icons with VPN badges
ICON_TYPE_DEFAULT_VIEW, // dark icons with VPN badges
ICON_TYPE_LIST, // dark icons without VPN badges
// Color theme based on icon background.
enum ResourceColorTheme {
COLOR_DARK,
COLOR_LIGHT,
};
// Gets the image for the network associated with |service_path|. |network| must
// not be NULL. |icon_type| determines the color theme and whether or not to
// show the VPN badge. This caches badged icons per network per |icon_type|.
// Get the image for the network associated with |service_path|.
// |color| determines the color theme. If the icon is animating (i.e the
// network is connecting) and |observer| is provided, it will be notified
// when the icon changes.
gfx::ImageSkia GetImageForNetwork(const chromeos::NetworkState* network,
IconType icon_type);
// Gets the image for a connecting network type.
gfx::ImageSkia GetImageForConnectingNetwork(IconType icon_type,
const std::string& network_type);
// Gets the image for a disconnected network type.
gfx::ImageSkia GetImageForDisconnectedNetwork(IconType icon_type,
const std::string& network_type);
// Returns the label for |network| based on |icon_type|. |network| can be NULL.
string16 GetLabelForNetwork(const chromeos::NetworkState* network,
IconType icon_type);
ResourceColorTheme color,
AnimationObserver* observer);
} // namespace network_icon
} // namespace ash
......
......@@ -48,17 +48,6 @@ void NetworkIconAnimation::RemoveObserver(AnimationObserver* observer) {
animation_.Stop();
}
void NetworkIconAnimation::AddNetwork(const std::string& network_id) {
networks_.insert(network_id);
// Animation will start (if stopped) when GetAnimation is called.
}
void NetworkIconAnimation::RemoveNetwork(const std::string& network_id) {
networks_.erase(network_id);
if (networks_.empty())
animation_.Reset();
}
// static
NetworkIconAnimation* NetworkIconAnimation::GetInstance() {
static NetworkIconAnimation* s_icon_animation =
......
......@@ -5,9 +5,6 @@
#ifndef ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_ANIMATION_H_
#define ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_ANIMATION_H_
#include <set>
#include <string>
#include "ash/ash_export.h"
#include "base/observer_list.h"
#include "ui/base/animation/animation_delegate.h"
......@@ -29,8 +26,6 @@ class ASH_EXPORT NetworkIconAnimation : public ui::AnimationDelegate {
void AddObserver(AnimationObserver* observer);
void RemoveObserver(AnimationObserver* observer);
void AddNetwork(const std::string& network_id);
void RemoveNetwork(const std::string& network_id);
// ui::AnimationDelegate implementation.
virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
......@@ -40,7 +35,6 @@ class ASH_EXPORT NetworkIconAnimation : public ui::AnimationDelegate {
private:
ui::ThrobAnimation animation_;
ObserverList<AnimationObserver> observers_;
std::set<std::string> networks_;
};
} // namespace network_icon
......
......@@ -27,9 +27,6 @@ class BubbleDelegateView;
namespace ash {
namespace internal {
class TrayNetwork;
namespace tray {
struct NetworkInfo;
......@@ -39,8 +36,7 @@ class NetworkStateListDetailedView : public NetworkDetailedView,
public ViewClickListener,
public network_icon::AnimationObserver {
public:
NetworkStateListDetailedView(TrayNetwork* tray_network,
user::LoginStatus login);
NetworkStateListDetailedView(SystemTrayItem* owner, user::LoginStatus login);
virtual ~NetworkStateListDetailedView();
// Overridden from NetworkDetailedView:
......@@ -63,9 +59,6 @@ class NetworkStateListDetailedView : public NetworkDetailedView,
virtual void ClickedOn(views::View* sender) OVERRIDE;
private:
typedef std::map<views::View*, std::string> NetworkMap;
typedef std::map<std::string, HoverHighlightView*> ServicePathMap;
// Create UI components.
void CreateHeaderEntry();
void CreateHeaderButtons();
......@@ -74,16 +67,11 @@ class NetworkStateListDetailedView : public NetworkDetailedView,
// Update UI components.
void UpdateHeaderButtons();
void UpdateNetworks(const NetworkStateList& networks);
void UpdateNetworkState();
void RefreshNetworkList();
bool CreateOrUpdateInfoLabel(
int index, const string16& text, views::Label** label);
bool UpdateNetworkChild(int index, const NetworkInfo* info);
bool OrderChild(views::View* view, int index);
bool UpdateNetworkListEntries(std::set<std::string>* new_service_paths);
void UpdateNetworks(const NetworkStateList& networks);
void UpdateNetworkEntries();
void UpdateNetworkExtra();
void UpdateNetworkIcons();
// Adds a settings entry when logged in, and an entry for changing proxy
// settings otherwise.
......@@ -94,17 +82,14 @@ class NetworkStateListDetailedView : public NetworkDetailedView,
bool ResetInfoBubble();
views::View* CreateNetworkInfoView();
// Typed pointer to the owning tray item.
TrayNetwork* tray_network_;
// Track login state.
user::LoginStatus login_;
// A map of child views to their network service path.
NetworkMap network_map_;
std::map<views::View*, std::string> network_map_;
// A map of network service paths to their view.
ServicePathMap service_path_map_;
std::map<std::string, HoverHighlightView*> service_path_map_;
// An owned list of network info.
ScopedVector<NetworkInfo> network_list_;
......@@ -126,8 +111,6 @@ class NetworkStateListDetailedView : public NetworkDetailedView,
TrayPopupLabelButton* settings_;
TrayPopupLabelButton* proxy_settings_;
views::Label* scanning_view_;
views::Label* no_wifi_networks_view_;
views::Label* no_cellular_networks_view_;
// A small bubble for displaying network info.
views::BubbleDelegateView* info_bubble_;
......
This diff is collapsed.
......@@ -5,17 +5,9 @@
#ifndef ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H
#define ASH_SYSTEM_CHROMEOS_NETWORK_TRAY_NETWORK_H
#include <set>
#include "ash/system/chromeos/network/network_icon.h"
#include "ash/system/chromeos/network/network_observer.h"
#include "ash/system/tray/system_tray_item.h"
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
namespace chromeos {
class NetworkState;
}
namespace ash {
namespace internal {
......@@ -65,28 +57,7 @@ class TrayNetwork : public SystemTrayItem,
virtual void ClearNetworkMessage(MessageType message_type) OVERRIDE;
virtual void OnWillToggleWifi() OVERRIDE;
// Called when the network for the tray icon may have been updated.
void TrayNetworkUpdated();
// Called when the properties for |network| may have been updated.
void NetworkServiceChanged(const chromeos::NetworkState* network);
// Request a network connection (called from detailed view).
void ConnectToNetwork(const std::string& service_path);
// Returns true if a user initiated connection to |network| occured.
bool HasConnectingNetwork(const std::string& service_path);
// Gets the correct icon and label for |icon_type|.
void GetNetworkStateHandlerImageAndLabel(network_icon::IconType icon_type,
gfx::ImageSkia* image,
string16* label);
// Updates and returns the appropriate message id if a network technology
// (i.e. cellular) is uninitialized.
int GetUninitializedMsg();
private:
private:
friend class tray::NetworkMessageView;
friend class tray::NetworkNotificationView;
......@@ -101,9 +72,6 @@ private:
scoped_ptr<tray::NetworkMessages> messages_;
bool request_wifi_view_;
scoped_ptr<TrayNetworkStateObserver> network_state_observer_;
std::set<std::string> connecting_networks_;
base::Time uninitialized_state_time_;
int uninitialized_msg_;
DISALLOW_COPY_AND_ASSIGN(TrayNetwork);
};
......
......@@ -43,24 +43,10 @@ void TrayNetworkStateObserver::NetworkListChanged() {
tray::NetworkDetailedView* detailed = tray_->detailed();
if (detailed)
detailed->NetworkListChanged();
tray_->TrayNetworkUpdated();
}
void TrayNetworkStateObserver::DeviceListChanged() {
tray::NetworkDetailedView* detailed = tray_->detailed();
if (detailed)
detailed->ManagerChanged();
tray_->TrayNetworkUpdated();
}
void TrayNetworkStateObserver::DefaultNetworkChanged(
const chromeos::NetworkState* network) {
tray_->TrayNetworkUpdated();
}
void TrayNetworkStateObserver::NetworkPropertiesUpdated(
const chromeos::NetworkState* network) {
tray_->NetworkServiceChanged(network);
tray::NetworkDetailedView* detailed = tray_->detailed();
if (detailed)
detailed->NetworkServiceChanged(network);
......
......@@ -30,9 +30,6 @@ class TrayNetworkStateObserver : public chromeos::NetworkStateHandlerObserver {
// NetworkStateHandlerObserver overrides.
virtual void NetworkManagerChanged() OVERRIDE;
virtual void NetworkListChanged() OVERRIDE;
virtual void DeviceListChanged() OVERRIDE;
virtual void DefaultNetworkChanged(
const chromeos::NetworkState* network) OVERRIDE;
virtual void NetworkPropertiesUpdated(
const chromeos::NetworkState* network) OVERRIDE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment