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

Side by Side Diff: ash/focus_cycler_unittest.cc

Issue 2072023003: mash: Break ash system tray dependencies on ash::ShelfWidget (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
« no previous file with comments | « ash/common/shelf/wm_shelf.h ('k') | ash/mus/bridge/wm_shelf_mus.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/focus_cycler.h" 5 #include "ash/common/focus_cycler.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "ash/common/shell_window_ids.h" 9 #include "ash/common/shell_window_ids.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 protected: 90 protected:
91 // Creates the system tray, returning true on success. 91 // Creates the system tray, returning true on success.
92 bool CreateTray() { 92 bool CreateTray() {
93 if (tray_) 93 if (tray_)
94 return false; 94 return false;
95 WmWindow* parent = 95 WmWindow* parent =
96 WmShell::Get()->GetRootWindowForNewWindows()->GetChildByShellWindowId( 96 WmShell::Get()->GetRootWindowForNewWindows()->GetChildByShellWindowId(
97 kShellWindowId_StatusContainer); 97 kShellWindowId_StatusContainer);
98 98
99 StatusAreaWidget* widget = new StatusAreaWidget(parent, shelf_widget()); 99 StatusAreaWidget* widget = new StatusAreaWidget(parent, GetPrimaryShelf());
100 widget->CreateTrayViews(); 100 widget->CreateTrayViews();
101 widget->Show(); 101 widget->Show();
102 tray_.reset(widget->system_tray()); 102 tray_.reset(widget->system_tray());
103 if (!tray_->GetWidget()) 103 if (!tray_->GetWidget())
104 return false; 104 return false;
105 focus_cycler_->AddWidget(tray()->GetWidget()); 105 focus_cycler_->AddWidget(tray()->GetWidget());
106 GetStatusAreaWidgetDelegate(tray_->GetWidget())->SetFocusCyclerForTesting( 106 GetStatusAreaWidgetDelegate(tray_->GetWidget())->SetFocusCyclerForTesting(
107 focus_cycler()); 107 focus_cycler());
108 return true; 108 return true;
109 } 109 }
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 // Cycle focus to the shelf. 423 // Cycle focus to the shelf.
424 WmShell::Get()->focus_cycler()->RotateFocus(FocusCycler::FORWARD); 424 WmShell::Get()->focus_cycler()->RotateFocus(FocusCycler::FORWARD);
425 425
426 // Cycle focus should go back to the browser. 426 // Cycle focus should go back to the browser.
427 WmShell::Get()->focus_cycler()->RotateFocus(FocusCycler::FORWARD); 427 WmShell::Get()->focus_cycler()->RotateFocus(FocusCycler::FORWARD);
428 EXPECT_TRUE(wm::IsActiveWindow(window.get())); 428 EXPECT_TRUE(wm::IsActiveWindow(window.get()));
429 } 429 }
430 430
431 } // namespace test 431 } // namespace test
432 } // namespace ash 432 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/wm_shelf.h ('k') | ash/mus/bridge/wm_shelf_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698