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

Side by Side Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 2007003002: mash: Preliminary support for shelf auto-hide (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shutdown
Patch Set: cleanup Created 4 years, 7 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/shelf/shelf_layout_manager.h" 5 #include "ash/shelf/shelf_layout_manager.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accelerators/accelerator_table.h" 8 #include "ash/accelerators/accelerator_table.h"
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 public: 235 public:
236 ShelfLayoutObserverTest() 236 ShelfLayoutObserverTest()
237 : changed_auto_hide_state_(false) { 237 : changed_auto_hide_state_(false) {
238 } 238 }
239 239
240 ~ShelfLayoutObserverTest() override {} 240 ~ShelfLayoutObserverTest() override {}
241 241
242 bool changed_auto_hide_state() const { return changed_auto_hide_state_; } 242 bool changed_auto_hide_state() const { return changed_auto_hide_state_; }
243 243
244 private: 244 private:
245 void OnAutoHideStateChanged(ShelfAutoHideState new_state) override { 245 // ShelfLayoutManagerObserver:
246 void OnAutoHideStateChanged(ShelfLayoutManager* layout_manager,
247 ShelfAutoHideState new_state) override {
246 changed_auto_hide_state_ = true; 248 changed_auto_hide_state_ = true;
247 } 249 }
248 250
249 bool changed_auto_hide_state_; 251 bool changed_auto_hide_state_;
250 252
251 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutObserverTest); 253 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutObserverTest);
252 }; 254 };
253 255
254 // Trivial item implementation that tracks its views for testing. 256 // Trivial item implementation that tracks its views for testing.
255 class TestItem : public SystemTrayItem { 257 class TestItem : public SystemTrayItem {
(...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after
2293 StatusAreaWidget* status_area_widget = 2295 StatusAreaWidget* status_area_widget =
2294 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget(); 2296 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget();
2295 EXPECT_TRUE(status_area_widget->IsVisible()); 2297 EXPECT_TRUE(status_area_widget->IsVisible());
2296 // Shelf should be in the first display's area. 2298 // Shelf should be in the first display's area.
2297 gfx::Rect status_area_bounds(status_area_widget->GetWindowBoundsInScreen()); 2299 gfx::Rect status_area_bounds(status_area_widget->GetWindowBoundsInScreen());
2298 EXPECT_TRUE(gfx::Rect(0, 0, 500, 400).Contains(status_area_bounds)); 2300 EXPECT_TRUE(gfx::Rect(0, 0, 500, 400).Contains(status_area_bounds));
2299 EXPECT_EQ(gfx::Point(500, 400), status_area_bounds.bottom_right()); 2301 EXPECT_EQ(gfx::Point(500, 400), status_area_bounds.bottom_right());
2300 } 2302 }
2301 2303
2302 } // namespace ash 2304 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698