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

Side by Side Diff: ash/wm/overview/window_selector_unittest.cc

Issue 2927693002: mash: Limit ShelfWindowWatcher to panels and dialogs. (Closed)
Patch Set: Fix panel behavior, unit tests, etc. Created 3 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "ash/accessibility_delegate.h" 8 #include "ash/accessibility_delegate.h"
9 #include "ash/accessibility_types.h" 9 #include "ash/accessibility_types.h"
10 #include "ash/drag_drop/drag_drop_controller.h" 10 #include "ash/drag_drop/drag_drop_controller.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 ParentWindowInPrimaryRootWindow(window); 138 ParentWindowInPrimaryRootWindow(window);
139 return widget; 139 return widget;
140 } 140 }
141 141
142 aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { 142 aura::Window* CreatePanelWindow(const gfx::Rect& bounds) {
143 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( 143 aura::Window* window = CreateTestWindowInShellWithDelegateAndType(
144 nullptr, aura::client::WINDOW_TYPE_PANEL, 0, bounds); 144 nullptr, aura::client::WINDOW_TYPE_PANEL, 0, bounds);
145 static int id = 0; 145 static int id = 0;
146 std::string shelf_id(ShelfID(base::IntToString(id++)).Serialize()); 146 std::string shelf_id(ShelfID(base::IntToString(id++)).Serialize());
147 window->SetProperty(kShelfIDKey, new std::string(shelf_id)); 147 window->SetProperty(kShelfIDKey, new std::string(shelf_id));
148 window->SetProperty<int>(kShelfItemTypeKey, TYPE_APP_PANEL);
148 window->SetProperty(aura::client::kTopViewInset, kHeaderHeight); 149 window->SetProperty(aura::client::kTopViewInset, kHeaderHeight);
149 shelf_view_test()->RunMessageLoopUntilAnimationsDone(); 150 shelf_view_test()->RunMessageLoopUntilAnimationsDone();
150 return window; 151 return window;
151 } 152 }
152 153
153 bool WindowsOverlapping(aura::Window* window1, aura::Window* window2) { 154 bool WindowsOverlapping(aura::Window* window1, aura::Window* window2) {
154 gfx::Rect window1_bounds = GetTransformedTargetBounds(window1); 155 gfx::Rect window1_bounds = GetTransformedTargetBounds(window1);
155 gfx::Rect window2_bounds = GetTransformedTargetBounds(window2); 156 gfx::Rect window2_bounds = GetTransformedTargetBounds(window2);
156 return window1_bounds.Intersects(window2_bounds); 157 return window1_bounds.Intersects(window2_bounds);
157 } 158 }
(...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 window.get(), gfx::Point(), HTCAPTION, ::wm::WINDOW_MOVE_SOURCE_MOUSE)); 1846 window.get(), gfx::Point(), HTCAPTION, ::wm::WINDOW_MOVE_SOURCE_MOUSE));
1846 ASSERT_TRUE(resizer.get()); 1847 ASSERT_TRUE(resizer.get());
1847 gfx::Point location = resizer->GetInitialLocation(); 1848 gfx::Point location = resizer->GetInitialLocation();
1848 location.Offset(20, 20); 1849 location.Offset(20, 20);
1849 resizer->Drag(location, 0); 1850 resizer->Drag(location, 0);
1850 ToggleOverview(); 1851 ToggleOverview();
1851 resizer->RevertDrag(); 1852 resizer->RevertDrag();
1852 } 1853 }
1853 1854
1854 } // namespace ash 1855 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698