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

Side by Side Diff: ash/wm/workspace/workspace_layout_manager_unittest.cc

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/workspace/workspace_layout_manager.h" 5 #include "ash/wm/workspace/workspace_layout_manager.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/shelf_layout_manager.h"
9 #include "ash/shelf/shelf_widget.h"
8 #include "ash/shell.h" 10 #include "ash/shell.h"
9 #include "ash/test/ash_test_base.h" 11 #include "ash/test/ash_test_base.h"
10 #include "ash/wm/property_util.h" 12 #include "ash/wm/property_util.h"
11 #include "ash/wm/shelf_layout_manager.h"
12 #include "ash/wm/window_util.h" 13 #include "ash/wm/window_util.h"
13 #include "ui/aura/client/aura_constants.h" 14 #include "ui/aura/client/aura_constants.h"
14 #include "ui/aura/root_window.h" 15 #include "ui/aura/root_window.h"
15 #include "ui/aura/test/test_windows.h" 16 #include "ui/aura/test/test_windows.h"
16 #include "ui/aura/window.h" 17 #include "ui/aura/window.h"
17 #include "ui/gfx/insets.h" 18 #include "ui/gfx/insets.h"
18 19
19 namespace ash { 20 namespace ash {
20 21
21 namespace { 22 namespace {
(...skipping 28 matching lines...) Expand all
50 virtual void OnWindowPropertyChanged(aura::Window* window, 51 virtual void OnWindowPropertyChanged(aura::Window* window,
51 const void* key, 52 const void* key,
52 intptr_t old) OVERRIDE { 53 intptr_t old) OVERRIDE {
53 if (!window_) 54 if (!window_)
54 return; 55 return;
55 56
56 if (wm::IsWindowMaximized(window)) { 57 if (wm::IsWindowMaximized(window)) {
57 aura::Window* w = window_; 58 aura::Window* w = window_;
58 window_ = NULL; 59 window_ = NULL;
59 60
60 gfx::Rect shelf_bounds( 61 gfx::Rect shelf_bounds(Shell::GetPrimaryRootWindowController()->
61 Shell::GetPrimaryRootWindowController()->shelf()->GetIdealBounds()); 62 shelf_layout_manager()->GetIdealBounds());
62 const gfx::Rect& window_bounds(w->bounds()); 63 const gfx::Rect& window_bounds(w->bounds());
63 w->SetBounds(gfx::Rect(window_bounds.x(), shelf_bounds.y() - 1, 64 w->SetBounds(gfx::Rect(window_bounds.x(), shelf_bounds.y() - 1,
64 window_bounds.width(), window_bounds.height())); 65 window_bounds.width(), window_bounds.height()));
65 } 66 }
66 } 67 }
67 68
68 private: 69 private:
69 aura::Window* window_; 70 aura::Window* window_;
70 71
71 DISALLOW_COPY_AND_ASSIGN(DontClobberRestoreBoundsWindowObserver); 72 DISALLOW_COPY_AND_ASSIGN(DontClobberRestoreBoundsWindowObserver);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 149
149 // Directly setting the bounds triggers a slightly different code path. Verify 150 // Directly setting the bounds triggers a slightly different code path. Verify
150 // that too. 151 // that too.
151 window->SetBounds(window_bounds); 152 window->SetBounds(window_bounds);
152 EXPECT_EQ(gfx::Rect(gfx::Point(100, 101), work_area).ToString(), 153 EXPECT_EQ(gfx::Rect(gfx::Point(100, 101), work_area).ToString(),
153 window->bounds().ToString()); 154 window->bounds().ToString());
154 } 155 }
155 156
156 } // namespace 157 } // namespace
157 } // namespace ash 158 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698