OLD | NEW |
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/shell.h" | 5 #include "ash/shell.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/display/mouse_cursor_event_filter.h" | 10 #include "ash/display/mouse_cursor_event_filter.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 EXPECT_TRUE(controller->IsScreenLocked()); | 345 EXPECT_TRUE(controller->IsScreenLocked()); |
346 GetSessionControllerClient()->UnlockScreen(); | 346 GetSessionControllerClient()->UnlockScreen(); |
347 EXPECT_FALSE(controller->IsScreenLocked()); | 347 EXPECT_FALSE(controller->IsScreenLocked()); |
348 } | 348 } |
349 | 349 |
350 TEST_F(ShellTest, LockScreenClosesActiveMenu) { | 350 TEST_F(ShellTest, LockScreenClosesActiveMenu) { |
351 SimpleMenuDelegate menu_delegate; | 351 SimpleMenuDelegate menu_delegate; |
352 std::unique_ptr<ui::SimpleMenuModel> menu_model( | 352 std::unique_ptr<ui::SimpleMenuModel> menu_model( |
353 new ui::SimpleMenuModel(&menu_delegate)); | 353 new ui::SimpleMenuModel(&menu_delegate)); |
354 menu_model->AddItem(0, base::ASCIIToUTF16("Menu item")); | 354 menu_model->AddItem(0, base::ASCIIToUTF16("Menu item")); |
355 views::Widget* widget = ShellPort::Get() | 355 views::Widget* widget = Shell::GetPrimaryRootWindowController() |
356 ->GetPrimaryRootWindow() | |
357 ->GetRootWindowController() | |
358 ->wallpaper_widget_controller() | 356 ->wallpaper_widget_controller() |
359 ->widget(); | 357 ->widget(); |
360 std::unique_ptr<views::MenuRunner> menu_runner( | 358 std::unique_ptr<views::MenuRunner> menu_runner( |
361 new views::MenuRunner(menu_model.get(), views::MenuRunner::CONTEXT_MENU)); | 359 new views::MenuRunner(menu_model.get(), views::MenuRunner::CONTEXT_MENU)); |
362 | 360 |
363 menu_runner->RunMenuAt(widget, NULL, gfx::Rect(), views::MENU_ANCHOR_TOPLEFT, | 361 menu_runner->RunMenuAt(widget, NULL, gfx::Rect(), views::MENU_ANCHOR_TOPLEFT, |
364 ui::MENU_SOURCE_MOUSE); | 362 ui::MENU_SOURCE_MOUSE); |
365 LockScreenAndVerifyMenuClosed(); | 363 LockScreenAndVerifyMenuClosed(); |
366 } | 364 } |
367 | 365 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 // the case with classic-ash where embedders can separately create | 511 // the case with classic-ash where embedders can separately create |
514 // aura::Windows. | 512 // aura::Windows. |
515 if (Shell::GetAshConfig() == Config::MASH) | 513 if (Shell::GetAshConfig() == Config::MASH) |
516 return; | 514 return; |
517 | 515 |
518 window_.reset(new aura::Window(NULL)); | 516 window_.reset(new aura::Window(NULL)); |
519 window_->Init(ui::LAYER_NOT_DRAWN); | 517 window_->Init(ui::LAYER_NOT_DRAWN); |
520 } | 518 } |
521 | 519 |
522 } // namespace ash | 520 } // namespace ash |
OLD | NEW |