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

Side by Side Diff: chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc

Issue 2861873002: Align the base of the shelf's context menu to the top edge of the shelf. (Closed)
Patch Set: Align the base of the shelf's context menu to the top edge of the shelf. 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
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 "ash/shelf/shelf_view.h" 5 #include "ash/shelf/shelf_view.h"
6 #include "ash/shelf/wm_shelf.h" 6 #include "ash/shelf/wm_shelf.h"
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm_window.h" 8 #include "ash/wm_window.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 156 }
157 157
158 private: 158 private:
159 DISALLOW_COPY_AND_ASSIGN(WindowSizerContextMenuTest); 159 DISALLOW_COPY_AND_ASSIGN(WindowSizerContextMenuTest);
160 }; 160 };
161 161
162 void OpenBrowserUsingContextMenuOnRootWindow(aura::Window* root_window) { 162 void OpenBrowserUsingContextMenuOnRootWindow(aura::Window* root_window) {
163 gfx::Point chrome_icon = 163 gfx::Point chrome_icon =
164 GetChromeIconBoundsForRootWindow(root_window).CenterPoint(); 164 GetChromeIconBoundsForRootWindow(root_window).CenterPoint();
165 gfx::Point release_point = chrome_icon; 165 gfx::Point release_point = chrome_icon;
166 release_point.Offset(50, -120); 166 // 50 is the distance from the chrome icon to leftest of the screen.
msw 2017/05/10 22:18:23 nit: s/leftest/the left edge/. Also, I'm not sure
minch1 2017/05/11 16:34:03 This is only my own understanding, I didn't check
msw 2017/05/11 17:13:39 Yeah, 0 sgtm; thanks for simplifying this mystifyi
167 // -153 moves from the chrome icon to the "New window" in the opened context
msw 2017/05/10 22:18:23 nit: // -153 moves the cursor up to the "New windo
168 // menu.
169 release_point.Offset(50, -153);
167 ui_controls::SendMouseMoveNotifyWhenDone( 170 ui_controls::SendMouseMoveNotifyWhenDone(
168 chrome_icon.x(), chrome_icon.y(), 171 chrome_icon.x(), chrome_icon.y(),
169 base::Bind(&WindowSizerContextMenuTest::Step1, release_point)); 172 base::Bind(&WindowSizerContextMenuTest::Step1, release_point));
170 base::RunLoop().Run(); 173 base::RunLoop().Run();
171 } 174 }
172 175
173 } // namespace 176 } // namespace
174 177
175 IN_PROC_BROWSER_TEST_F(WindowSizerContextMenuTest, 178 IN_PROC_BROWSER_TEST_F(WindowSizerContextMenuTest,
176 MAYBE_OpenBrowserUsingContextMenuOnOtherDisplay) { 179 MAYBE_OpenBrowserUsingContextMenuOnOtherDisplay) {
(...skipping 21 matching lines...) Expand all
198 201
199 CloseBrowser(browser_list->get(0)); 202 CloseBrowser(browser_list->get(0));
200 OpenBrowserUsingContextMenuOnRootWindow(root_windows[0]); 203 OpenBrowserUsingContextMenuOnRootWindow(root_windows[0]);
201 204
202 // Next new browser must be created on 1st display. 205 // Next new browser must be created on 1st display.
203 ASSERT_EQ(1u, browser_list->size()); 206 ASSERT_EQ(1u, browser_list->size());
204 EXPECT_EQ(root_windows[0], 207 EXPECT_EQ(root_windows[0],
205 browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow()); 208 browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow());
206 EXPECT_EQ(root_windows[0], ash::Shell::GetRootWindowForNewWindows()); 209 EXPECT_EQ(root_windows[0], ash::Shell::GetRootWindowForNewWindows());
207 } 210 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698