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

Side by Side Diff: ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc

Issue 2185773002: Refactor: remove SetDisplayWorkAreaInsets calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor: remove SetDisplayWorkAreaInsets calls. Created 4 years, 4 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/shell.cc ('k') | components/exo/wayland/server.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/system/web_notification/ash_popup_alignment_delegate.h" 5 #include "ash/common/system/web_notification/ash_popup_alignment_delegate.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/shelf/shelf_types.h" 10 #include "ash/common/shelf/shelf_types.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 enum Position { TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT, OUTSIDE }; 49 enum Position { TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT, OUTSIDE };
50 50
51 AshPopupAlignmentDelegate* alignment_delegate() { 51 AshPopupAlignmentDelegate* alignment_delegate() {
52 return alignment_delegate_.get(); 52 return alignment_delegate_.get();
53 } 53 }
54 54
55 void UpdateWorkArea(AshPopupAlignmentDelegate* alignment_delegate, 55 void UpdateWorkArea(AshPopupAlignmentDelegate* alignment_delegate,
56 const display::Display& display) { 56 const display::Display& display) {
57 alignment_delegate->StartObserving(display::Screen::GetScreen(), display); 57 alignment_delegate->StartObserving(display::Screen::GetScreen(), display);
58 // Update the layout 58 // Update the layout
59 alignment_delegate->OnDisplayWorkAreaInsetsChanged(); 59 alignment_delegate->UpdateWorkArea();
60 } 60 }
61 61
62 void SetAlignmentDelegate( 62 void SetAlignmentDelegate(
63 std::unique_ptr<AshPopupAlignmentDelegate> delegate) { 63 std::unique_ptr<AshPopupAlignmentDelegate> delegate) {
64 if (!delegate.get()) { 64 if (!delegate.get()) {
65 alignment_delegate_.reset(); 65 alignment_delegate_.reset();
66 return; 66 return;
67 } 67 }
68 alignment_delegate_ = std::move(delegate); 68 alignment_delegate_ = std::move(delegate);
69 UpdateWorkArea(alignment_delegate_.get(), 69 UpdateWorkArea(alignment_delegate_.get(),
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 shelf->SetKeyboardBoundsForTesting(keyboard_bounds); 307 shelf->SetKeyboardBoundsForTesting(keyboard_bounds);
308 int keyboard_baseline = alignment_delegate()->GetBaseLine(); 308 int keyboard_baseline = alignment_delegate()->GetBaseLine();
309 EXPECT_NE(baseline, keyboard_baseline); 309 EXPECT_NE(baseline, keyboard_baseline);
310 EXPECT_GT(keyboard_bounds.y(), keyboard_baseline); 310 EXPECT_GT(keyboard_bounds.y(), keyboard_baseline);
311 311
312 shelf->SetKeyboardBoundsForTesting(gfx::Rect()); 312 shelf->SetKeyboardBoundsForTesting(gfx::Rect());
313 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine()); 313 EXPECT_EQ(baseline, alignment_delegate()->GetBaseLine());
314 } 314 }
315 315
316 } // namespace ash 316 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698