Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: ash/shelf/dimmer_view.h

Issue 2235513002: mash shelf: Don't create shelf DimmerView in ShelfWidget on mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/mus/bridge/wm_shelf_mus.cc ('k') | ash/shelf/dimmer_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/dimmer_view.h
diff --git a/ash/shelf/dimmer_view.h b/ash/shelf/dimmer_view.h
index 0a4ff07a1c7b5b0b2ef4a7bb3a780dae36fa7611..e4b9ad02409db96b0362788f23bf35b8259d35bc 100644
--- a/ash/shelf/dimmer_view.h
+++ b/ash/shelf/dimmer_view.h
@@ -5,6 +5,7 @@
#ifndef ASH_SHELF_DIMMER_VIEW_H_
#define ASH_SHELF_DIMMER_VIEW_H_
+#include "ash/common/shelf/wm_dimmer_view.h"
#include "ash/common/wm/background_animator.h"
#include "ash/common/wm_window_observer.h"
#include "base/macros.h"
@@ -17,21 +18,22 @@ namespace ash {
class WmShelf;
// DimmerView slightly dims shelf items when a window is maximized and visible.
+// TODO(jamescook): Delete this after material design ships, as MD will not
+// require shelf dimming. http://crbug.com/614453
class DimmerView : public views::View,
public views::WidgetDelegate,
public BackgroundAnimatorDelegate,
+ public WmDimmerView,
public WmWindowObserver {
public:
- // Creates and shows a DimmerView and its Widget.
- // If |disable_animations_for_test| is set, all changes apply instantly.
+ // Creates and shows a DimmerView and its Widget. The returned view is owned
+ // by its widget. If |disable_animations_for_test| is set, all changes apply
+ // instantly.
static DimmerView* Create(WmShelf* shelf, bool disable_animations_for_test);
// Called by |DimmerEventFilter| when the mouse |hovered| state changes.
void SetHovered(bool hovered);
- // Force the dimmer to be undimmed.
- void ForceUndimming(bool force);
-
// views::View overrides:
void OnPaintBackground(gfx::Canvas* canvas) override;
@@ -43,6 +45,11 @@ class DimmerView : public views::View,
void UpdateBackground(BackgroundAnimator* animator, int alpha) override;
void BackgroundAnimationEnded(BackgroundAnimator* animator) override;
+ // WmDimmerView:
+ views::Widget* GetDimmerWidget() override;
+ void ForceUndimming(bool force) override;
+ int GetDimmingAlphaForTest() override;
+
// WmWindowObserver overrides:
// This will be called when the shelf itself changes its absolute position.
// Since the |dimmer_| panel needs to be placed in screen coordinates it needs
@@ -52,9 +59,6 @@ class DimmerView : public views::View,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) override;
- // A function to test the current alpha used.
- int get_dimming_alpha_for_test() { return alpha_; }
-
private:
DimmerView(WmShelf* shelf, bool disable_animations_for_test);
~DimmerView() override;
« no previous file with comments | « ash/mus/bridge/wm_shelf_mus.cc ('k') | ash/shelf/dimmer_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698