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

Side by Side Diff: ash/wm/panels/panel_layout_manager_unittest.cc

Issue 2896273004: chromeos: converts PanelLayoutManager to aura::Window (Closed)
Patch Set: feedback Created 3 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
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | ash/wm/panels/panel_window_resizer.cc » ('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/wm/panels/panel_layout_manager.h" 5 #include "ash/wm/panels/panel_layout_manager.h"
6 6
7 #include "ash/public/cpp/config.h" 7 #include "ash/public/cpp/config.h"
8 #include "ash/public/cpp/shelf_types.h" 8 #include "ash/public/cpp/shelf_types.h"
9 #include "ash/public/cpp/shell_window_ids.h" 9 #include "ash/public/cpp/shell_window_ids.h"
10 #include "ash/public/cpp/window_properties.h" 10 #include "ash/public/cpp/window_properties.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { 98 aura::Window* CreatePanelWindow(const gfx::Rect& bounds) {
99 return CreatePanelWindowWithDelegate(nullptr, bounds); 99 return CreatePanelWindowWithDelegate(nullptr, bounds);
100 } 100 }
101 101
102 aura::Window* GetPanelContainer(aura::Window* panel) { 102 aura::Window* GetPanelContainer(aura::Window* panel) {
103 return Shell::GetContainer(panel->GetRootWindow(), 103 return Shell::GetContainer(panel->GetRootWindow(),
104 kShellWindowId_PanelContainer); 104 kShellWindowId_PanelContainer);
105 } 105 }
106 106
107 views::Widget* GetCalloutWidgetForPanel(aura::Window* panel) { 107 views::Widget* GetCalloutWidgetForPanel(aura::Window* panel) {
108 WmWindow* wm_panel = WmWindow::Get(panel); 108 PanelLayoutManager* manager = PanelLayoutManager::Get(panel);
109 PanelLayoutManager* manager = PanelLayoutManager::Get(wm_panel);
110 DCHECK(manager); 109 DCHECK(manager);
111 PanelLayoutManager::PanelList::iterator found = 110 PanelLayoutManager::PanelList::iterator found = std::find(
112 std::find(manager->panel_windows_.begin(), 111 manager->panel_windows_.begin(), manager->panel_windows_.end(), panel);
113 manager->panel_windows_.end(), wm_panel);
114 DCHECK(found != manager->panel_windows_.end()); 112 DCHECK(found != manager->panel_windows_.end());
115 DCHECK(found->callout_widget); 113 DCHECK(found->callout_widget);
116 return found->CalloutWidget(); 114 return found->CalloutWidget();
117 } 115 }
118 116
119 void PanelInScreen(aura::Window* panel) { 117 void PanelInScreen(aura::Window* panel) {
120 gfx::Rect panel_bounds = panel->GetBoundsInRootWindow(); 118 gfx::Rect panel_bounds = panel->GetBoundsInRootWindow();
121 gfx::Point root_point = gfx::Point(panel_bounds.x(), panel_bounds.y()); 119 gfx::Point root_point = gfx::Point(panel_bounds.x(), panel_bounds.y());
122 display::Display display = 120 display::Display display =
123 display::Screen::GetScreen()->GetDisplayNearestPoint(root_point); 121 display::Screen::GetScreen()->GetDisplayNearestPoint(root_point);
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5)); 927 touch.set_location(gfx::Point(bounds.x() - 1, bounds.y() + 5));
930 target = targeter->FindTargetForEvent(root, &touch); 928 target = targeter->FindTargetForEvent(root, &touch);
931 EXPECT_NE(w.get(), target); 929 EXPECT_NE(w.get(), target);
932 } 930 }
933 931
934 INSTANTIATE_TEST_CASE_P(LtrRtl, 932 INSTANTIATE_TEST_CASE_P(LtrRtl,
935 PanelLayoutManagerTextDirectionTest, 933 PanelLayoutManagerTextDirectionTest,
936 testing::Bool()); 934 testing::Bool());
937 935
938 } // namespace ash 936 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | ash/wm/panels/panel_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698