Commit 37549ddb authored by Mohsen Izadi's avatar Mohsen Izadi Committed by Commit Bot

Remove spinner from connectivity rows in system menu

According to MD specs for system menu detailed views, there is no
spinner for network/vpn/bluetooth rows that are trying to connect.

BUG=724680
TEST=none

Change-Id: If610554c95b1c35ffbcc32bd6ad9f51927bf558d
Reviewed-on: https://chromium-review.googlesource.com/509231
Commit-Queue: Mohsen Izadi <mohsen@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#473817}
parent 436a4cf7
...@@ -535,8 +535,6 @@ component("ash") { ...@@ -535,8 +535,6 @@ component("ash") {
"system/tray/system_tray_item.h", "system/tray/system_tray_item.h",
"system/tray/system_tray_notifier.cc", "system/tray/system_tray_notifier.cc",
"system/tray/system_tray_notifier.h", "system/tray/system_tray_notifier.h",
"system/tray/throbber_view.cc",
"system/tray/throbber_view.h",
"system/tray/tray_background_view.cc", "system/tray/tray_background_view.cc",
"system/tray/tray_background_view.h", "system/tray/tray_background_view.h",
"system/tray/tray_bubble_wrapper.cc", "system/tray/tray_bubble_wrapper.cc",
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "ash/system/tray/system_tray.h" #include "ash/system/tray/system_tray.h"
#include "ash/system/tray/system_tray_controller.h" #include "ash/system/tray/system_tray_controller.h"
#include "ash/system/tray/system_tray_notifier.h" #include "ash/system/tray/system_tray_notifier.h"
#include "ash/system/tray/throbber_view.h"
#include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_details_view.h" #include "ash/system/tray/tray_details_view.h"
#include "ash/system/tray/tray_item_more.h" #include "ash/system/tray/tray_item_more.h"
...@@ -350,9 +349,6 @@ class BluetoothDetailedView : public TrayDetailsView { ...@@ -350,9 +349,6 @@ class BluetoothDetailedView : public TrayDetailsView {
void SetupConnectingItem(HoverHighlightView* container) { void SetupConnectingItem(HoverHighlightView* container) {
container->SetSubText(l10n_util::GetStringUTF16( container->SetSubText(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_NETWORK_STATUS_CONNECTING)); IDS_ASH_STATUS_TRAY_NETWORK_STATUS_CONNECTING));
ThrobberView* throbber = new ThrobberView;
throbber->Start();
container->AddRightView(throbber);
} }
// Returns true if the device with |device_id| is found in |device_list|. // Returns true if the device with |device_id| is found in |device_list|.
......
...@@ -14,12 +14,10 @@ ...@@ -14,12 +14,10 @@
#include "ash/system/network/network_info.h" #include "ash/system/network/network_info.h"
#include "ash/system/network/network_state_list_detailed_view.h" #include "ash/system/network/network_state_list_detailed_view.h"
#include "ash/system/networking_config_delegate.h" #include "ash/system/networking_config_delegate.h"
#include "ash/system/tray/hover_highlight_view.h" #include "ash/system/tray/hover_highlight_view.h"
#include "ash/system/tray/system_menu_button.h" #include "ash/system/tray/system_menu_button.h"
#include "ash/system/tray/system_tray_controller.h" #include "ash/system/tray/system_tray_controller.h"
#include "ash/system/tray/system_tray_delegate.h" #include "ash/system/tray/system_tray_delegate.h"
#include "ash/system/tray/throbber_view.h"
#include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_popup_item_style.h" #include "ash/system/tray/tray_popup_item_style.h"
#include "ash/system/tray/tray_popup_utils.h" #include "ash/system/tray/tray_popup_utils.h"
...@@ -105,9 +103,6 @@ void SetupConnectingItem(HoverHighlightView* container, ...@@ -105,9 +103,6 @@ void SetupConnectingItem(HoverHighlightView* container,
container->AddIconAndLabels( container->AddIconAndLabels(
image, text, image, text,
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_STATUS_CONNECTING)); l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_STATUS_CONNECTING));
ThrobberView* throbber = new ThrobberView;
throbber->Start();
container->AddRightView(throbber);
} }
} // namespace } // namespace
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "ash/system/tray/hover_highlight_view.h" #include "ash/system/tray/hover_highlight_view.h"
#include "ash/system/tray/system_menu_button.h" #include "ash/system/tray/system_menu_button.h"
#include "ash/system/tray/system_tray_controller.h" #include "ash/system/tray/system_tray_controller.h"
#include "ash/system/tray/throbber_view.h"
#include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_popup_utils.h" #include "ash/system/tray/tray_popup_utils.h"
#include "ash/system/tray/tri_view.h" #include "ash/system/tray/tri_view.h"
...@@ -228,9 +227,6 @@ void VPNListNetworkEntry::SetupConnectingItem(const base::string16& text, ...@@ -228,9 +227,6 @@ void VPNListNetworkEntry::SetupConnectingItem(const base::string16& text,
AddIconAndLabels( AddIconAndLabels(
image, text, image, text,
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_STATUS_CONNECTING)); l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_NETWORK_STATUS_CONNECTING));
ThrobberView* throbber = new ThrobberView;
throbber->Start();
AddRightView(throbber);
} }
} // namespace } // namespace
......
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/system/tray/throbber_view.h"
#include "ash/resources/grit/ash_resources.h"
#include "ash/system/tray/tray_constants.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
namespace ash {
namespace {
// Duration for showing/hiding animation in milliseconds.
const int kThrobberAnimationDurationMs = 200;
} // namespace
SystemTrayThrobber::SystemTrayThrobber() : views::SmoothedThrobber() {}
SystemTrayThrobber::~SystemTrayThrobber() {}
void SystemTrayThrobber::SetTooltipText(const base::string16& tooltip_text) {
tooltip_text_ = tooltip_text;
}
bool SystemTrayThrobber::GetTooltipText(const gfx::Point& p,
base::string16* tooltip) const {
if (tooltip_text_.empty())
return false;
*tooltip = tooltip_text_;
return true;
}
ThrobberView::ThrobberView() {
throbber_ = new SystemTrayThrobber();
throbber_->set_stop_delay_ms(kThrobberAnimationDurationMs);
AddChildView(throbber_);
SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false);
layer()->SetOpacity(0.0);
}
ThrobberView::~ThrobberView() {}
gfx::Size ThrobberView::CalculatePreferredSize() const {
return gfx::Size(kTrayPopupItemMinHeight, kTrayPopupItemMinHeight);
}
void ThrobberView::Layout() {
View* child = child_at(0);
gfx::Size ps = child->GetPreferredSize();
child->SetBounds((width() - ps.width()) / 2, (height() - ps.height()) / 2,
ps.width(), ps.height());
SizeToPreferredSize();
}
bool ThrobberView::GetTooltipText(const gfx::Point& p,
base::string16* tooltip) const {
if (tooltip_text_.empty())
return false;
*tooltip = tooltip_text_;
return true;
}
void ThrobberView::Start() {
ScheduleAnimation(true);
throbber_->Start();
}
void ThrobberView::Stop() {
ScheduleAnimation(false);
throbber_->Stop();
}
void ThrobberView::SetTooltipText(const base::string16& tooltip_text) {
tooltip_text_ = tooltip_text;
throbber_->SetTooltipText(tooltip_text);
}
void ThrobberView::ScheduleAnimation(bool start_throbber) {
// Stop any previous animation.
layer()->GetAnimator()->StopAnimating();
ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator());
animation.SetTransitionDuration(
base::TimeDelta::FromMilliseconds(kThrobberAnimationDurationMs));
layer()->SetOpacity(start_throbber ? 1.0 : 0.0);
}
} // namespace ash
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_SYSTEM_TRAY_THROBBER_VIEW_H_
#define ASH_SYSTEM_TRAY_THROBBER_VIEW_H_
#include "base/macros.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/controls/throbber.h"
#include "ui/views/view.h"
namespace ash {
// A SmoothedThrobber with tooltip.
class SystemTrayThrobber : public views::SmoothedThrobber {
public:
SystemTrayThrobber();
~SystemTrayThrobber() override;
void SetTooltipText(const base::string16& tooltip_text);
// Overriden from views::View.
bool GetTooltipText(const gfx::Point& p,
base::string16* tooltip) const override;
private:
// The current tooltip text.
base::string16 tooltip_text_;
DISALLOW_COPY_AND_ASSIGN(SystemTrayThrobber);
};
// A View containing a SystemTrayThrobber with animation for starting/stopping.
class ThrobberView : public views::View {
public:
ThrobberView();
~ThrobberView() override;
void Start();
void Stop();
void SetTooltipText(const base::string16& tooltip_text);
// Overriden from views::View.
gfx::Size CalculatePreferredSize() const override;
void Layout() override;
bool GetTooltipText(const gfx::Point& p,
base::string16* tooltip) const override;
private:
// Schedules animation for starting/stopping throbber.
void ScheduleAnimation(bool start_throbber);
SystemTrayThrobber* throbber_;
// The current tooltip text.
base::string16 tooltip_text_;
DISALLOW_COPY_AND_ASSIGN(ThrobberView);
};
} // namespace ash
#endif // ASH_SYSTEM_TRAY_THROBBER_VIEW_H_
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