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

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

Issue 1907363004: (Merge to M-51) Revise the shelf alignment locking mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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/test/shelf_test_api.cc ('k') | ash/wm/panels/panel_layout_manager.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/wm/panels/attached_panel_window_targeter.h" 5 #include "ash/wm/panels/attached_panel_window_targeter.h"
6 6
7 #include "ash/shelf/shelf.h" 7 #include "ash/shelf/shelf.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/wm/panels/panel_layout_manager.h" 9 #include "ash/wm/panels/panel_layout_manager.h"
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 UpdateTouchExtend(root_window); 42 UpdateTouchExtend(root_window);
43 } 43 }
44 44
45 void AttachedPanelWindowTargeter::UpdateTouchExtend(aura::Window* root_window) { 45 void AttachedPanelWindowTargeter::UpdateTouchExtend(aura::Window* root_window) {
46 // Only update the touch insets for panels if they are attached to the shelf 46 // Only update the touch insets for panels if they are attached to the shelf
47 // in |root_window|. 47 // in |root_window|.
48 if (panel_container_->GetRootWindow() != root_window) 48 if (panel_container_->GetRootWindow() != root_window)
49 return; 49 return;
50 50
51 DCHECK(panel_layout_manager_->shelf()); 51 DCHECK(panel_layout_manager_->shelf());
52
53 gfx::Insets touch(default_touch_extend_); 52 gfx::Insets touch(default_touch_extend_);
54 switch (panel_layout_manager_->shelf()->alignment()) { 53 set_touch_extend(panel_layout_manager_->shelf()->SelectValueForShelfAlignment(
55 case SHELF_ALIGNMENT_BOTTOM: 54 gfx::Insets(touch.top(), touch.left(), 0, touch.right()),
56 touch = gfx::Insets(touch.top(), touch.left(), 0, touch.right()); 55 gfx::Insets(touch.top(), 0, touch.bottom(), touch.right()),
57 break; 56 gfx::Insets(touch.top(), touch.left(), touch.bottom(), 0)));
58 case SHELF_ALIGNMENT_LEFT:
59 touch = gfx::Insets(touch.top(), 0, touch.bottom(), touch.right());
60 break;
61 case SHELF_ALIGNMENT_RIGHT:
62 touch = gfx::Insets(touch.top(), touch.left(), touch.bottom(), 0);
63 break;
64 }
65
66 set_touch_extend(touch);
67 } 57 }
68 58
69 } // namespace ash 59 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/shelf_test_api.cc ('k') | ash/wm/panels/panel_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698