#include "ash/system/tray/tray_background_view.h"
-#include "ash/ash_switches.h"
#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/ui_base_switches_util.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_element.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
: host_(host) {
}
- virtual void OnWidgetBoundsChanged(views::Widget* widget,
- const gfx::Rect& new_bounds) OVERRIDE {
+ void OnWidgetBoundsChanged(views::Widget* widget,
+ const gfx::Rect& new_bounds) override {
host_->AnchorUpdated();
}
- virtual void OnWidgetVisibilityChanged(views::Widget* widget,
- bool visible) OVERRIDE {
+ void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override {
host_->AnchorUpdated();
}
IDR_AURA_TRAY_BG_VERTICAL_BOTTOM_PRESSED).ToImageSkia();
}
- virtual ~TrayBackground() {}
+ ~TrayBackground() override {}
SkColor color() { return color_; }
void set_color(SkColor color) { color_ = color; }
}
// Overridden from views::Background.
- virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE {
+ void Paint(gfx::Canvas* canvas, views::View* view) const override {
int orientation = kImageHorizontal;
ShelfWidget* shelf_widget = GetShelfWidget();
if (shelf_widget &&
kTrayBackgroundHoverAlpha - kTrayBackgroundAlpha),
hovered_(false),
draw_background_as_active_(false),
- touch_feedback_enabled_(false),
widget_observer_(new TrayWidgetObserver(this)) {
set_notify_enter_exit_on_child(true);
SetFillsBoundsOpaquely(false);
// Start the tray items not visible, because visibility changes are animated.
views::View::SetVisible(false);
-
- if (CommandLine::ForCurrentProcess()->
- HasSwitch(switches::kAshEnableTouchViewTouchFeedback)) {
- touch_feedback_enabled_ = true;
- }
}
TrayBackgroundView::~TrayBackgroundView() {
}
void TrayBackgroundView::OnGestureEvent(ui::GestureEvent* event) {
- if (touch_feedback_enabled_) {
+ if (switches::IsTouchFeedbackEnabled()) {
if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
SetDrawBackgroundAsActive(true);
} else if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN ||