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

Unified Diff: ash/wm/window_animations.cc

Issue 2274333002: ash: Move more code from Shelf to WmShelf (Closed)
Patch Set: review comments 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
Index: ash/wm/window_animations.cc
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc
index db73900fdebae3cb11fe27127a5fb7f48a811820..36fcd5825cebf1e6ad8720f3f5351f44cf7511c1 100644
--- a/ash/wm/window_animations.cc
+++ b/ash/wm/window_animations.cc
@@ -10,18 +10,13 @@
#include <vector>
#include "ash/aura/wm_window_aura.h"
-#include "ash/common/shelf/shelf.h"
-#include "ash/common/shelf/shelf_layout_manager.h"
-#include "ash/common/shelf/shelf_widget.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/wm/window_animation_types.h"
#include "ash/screen_util.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace_controller.h"
-#include "base/command_line.h"
-#include "base/compiler_specific.h"
+#include "base/i18n/rtl.h"
#include "base/logging.h"
-#include "base/message_loop/message_loop.h"
#include "base/stl_util.h"
#include "base/time/time.h"
#include "ui/aura/client/aura_constants.h"
@@ -37,11 +32,8 @@
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
-#include "ui/gfx/geometry/vector3d_f.h"
#include "ui/gfx/interpolated_transform.h"
#include "ui/gfx/transform.h"
-#include "ui/views/view.h"
-#include "ui/views/widget/widget.h"
#include "ui/wm/core/window_util.h"
namespace ash {
@@ -436,10 +428,7 @@ CreateBrightnessGrayscaleAnimationSequence(float target_value,
gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) {
WmWindow* wm_window = WmWindowAura::Get(window);
- Shelf* shelf = Shelf::ForWindow(wm_window);
- // Shelf is created lazily and can be NULL.
- if (!shelf)
- return gfx::Rect();
+ WmShelf* shelf = WmShelf::ForWindow(wm_window);
gfx::Rect item_rect = shelf->GetScreenBoundsOfItemIconForWindow(wm_window);
// The launcher item is visible and has an icon.
@@ -452,11 +441,11 @@ gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) {
// are still reported correctly and the window can be animated to the launcher
// item's light bar.
if (item_rect.width() != 0 || item_rect.height() != 0) {
- if (shelf->shelf_layout_manager()->visibility_state() == SHELF_AUTO_HIDE) {
- gfx::Rect shelf_bounds = shelf->shelf_widget()->GetWindowBoundsInScreen();
- if (shelf->wm_shelf()->alignment() == SHELF_ALIGNMENT_LEFT)
+ if (shelf->GetVisibilityState() == SHELF_AUTO_HIDE) {
+ gfx::Rect shelf_bounds = shelf->GetWindow()->GetBoundsInScreen();
+ if (shelf->alignment() == SHELF_ALIGNMENT_LEFT)
item_rect.set_x(shelf_bounds.right());
- else if (shelf->wm_shelf()->alignment() == SHELF_ALIGNMENT_RIGHT)
+ else if (shelf->alignment() == SHELF_ALIGNMENT_RIGHT)
item_rect.set_x(shelf_bounds.x());
else
item_rect.set_y(shelf_bounds.y());
@@ -470,7 +459,7 @@ gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) {
gfx::Rect work_area =
display::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area();
int ltr_adjusted_x = base::i18n::IsRTL() ? work_area.right() : work_area.x();
- switch (shelf->wm_shelf()->alignment()) {
+ switch (shelf->alignment()) {
case SHELF_ALIGNMENT_BOTTOM:
case SHELF_ALIGNMENT_BOTTOM_LOCKED:
return gfx::Rect(ltr_adjusted_x, work_area.bottom(), 0, 0);
« no previous file with comments | « ash/shelf/shelf_widget_unittest.cc ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698