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

Side by Side Diff: ash/shelf/shelf_layout_manager.cc

Issue 195793004: Implement overscroll support for the virtual keyboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit test. Created 6 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 | Annotate | Revision Log
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/shelf/shelf_layout_manager.h" 5 #include "ash/shelf/shelf_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <cstring> 9 #include <cstring>
10 #include <string> 10 #include <string>
(...skipping 28 matching lines...) Expand all
39 #include "ui/aura/client/cursor_client.h" 39 #include "ui/aura/client/cursor_client.h"
40 #include "ui/aura/window_event_dispatcher.h" 40 #include "ui/aura/window_event_dispatcher.h"
41 #include "ui/base/ui_base_switches.h" 41 #include "ui/base/ui_base_switches.h"
42 #include "ui/compositor/layer.h" 42 #include "ui/compositor/layer.h"
43 #include "ui/compositor/layer_animation_observer.h" 43 #include "ui/compositor/layer_animation_observer.h"
44 #include "ui/compositor/layer_animator.h" 44 #include "ui/compositor/layer_animator.h"
45 #include "ui/compositor/scoped_layer_animation_settings.h" 45 #include "ui/compositor/scoped_layer_animation_settings.h"
46 #include "ui/events/event.h" 46 #include "ui/events/event.h"
47 #include "ui/events/event_handler.h" 47 #include "ui/events/event_handler.h"
48 #include "ui/gfx/screen.h" 48 #include "ui/gfx/screen.h"
49 #include "ui/keyboard/keyboard_util.h"
49 #include "ui/views/widget/widget.h" 50 #include "ui/views/widget/widget.h"
50 #include "ui/wm/public/activation_client.h" 51 #include "ui/wm/public/activation_client.h"
51 52
52 namespace ash { 53 namespace ash {
53 namespace { 54 namespace {
54 55
55 // Delay before showing the shelf. This is after the mouse stops moving. 56 // Delay before showing the shelf. This is after the mouse stops moving.
56 const int kAutoHideDelayMS = 200; 57 const int kAutoHideDelayMS = 200;
57 58
58 // To avoid hiding the shelf when the mouse transitions from a message bubble 59 // To avoid hiding the shelf when the mouse transitions from a message bubble
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 gfx::Insets(0, 0, GetWorkAreaSize(state, shelf_height), 0), 840 gfx::Insets(0, 0, GetWorkAreaSize(state, shelf_height), 0),
840 gfx::Insets(0, GetWorkAreaSize(state, shelf_width), 0, 0), 841 gfx::Insets(0, GetWorkAreaSize(state, shelf_width), 0, 0),
841 gfx::Insets(0, 0, 0, GetWorkAreaSize(state, shelf_width)), 842 gfx::Insets(0, 0, 0, GetWorkAreaSize(state, shelf_width)),
842 gfx::Insets(GetWorkAreaSize(state, shelf_height), 0, 0, 0)); 843 gfx::Insets(GetWorkAreaSize(state, shelf_height), 0, 0, 0));
843 844
844 // TODO(varkha): The functionality of managing insets for display areas 845 // TODO(varkha): The functionality of managing insets for display areas
845 // should probably be pushed to a separate component. This would simplify or 846 // should probably be pushed to a separate component. This would simplify or
846 // remove entirely the dependency on keyboard and dock. 847 // remove entirely the dependency on keyboard and dock.
847 848
848 // Also push in the work area inset for the keyboard if it is visible. 849 // Also push in the work area inset for the keyboard if it is visible.
849 if (!keyboard_bounds_.IsEmpty()) { 850 if (!keyboard_bounds_.IsEmpty() && !keyboard::IsKeyboardOverscrollEnabled()) {
850 gfx::Insets keyboard_insets(0, 0, keyboard_bounds_.height(), 0); 851 gfx::Insets keyboard_insets(0, 0, keyboard_bounds_.height(), 0);
851 target_bounds->work_area_insets += keyboard_insets; 852 target_bounds->work_area_insets += keyboard_insets;
852 } 853 }
853 854
854 // Also push in the work area inset for the dock if it is visible. 855 // Also push in the work area inset for the dock if it is visible.
855 if (!dock_bounds_.IsEmpty()) { 856 if (!dock_bounds_.IsEmpty()) {
856 gfx::Insets dock_insets( 857 gfx::Insets dock_insets(
857 0, (dock_bounds_.x() > 0 ? 0 : dock_bounds_.width()), 858 0, (dock_bounds_.x() > 0 ? 0 : dock_bounds_.width()),
858 0, (dock_bounds_.x() > 0 ? dock_bounds_.width() : 0)); 859 0, (dock_bounds_.x() > 0 ? dock_bounds_.width() : 0));
859 target_bounds->work_area_insets += dock_insets; 860 target_bounds->work_area_insets += dock_insets;
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 base::AutoReset<ShelfVisibilityState> state(&state_.visibility_state, 1195 base::AutoReset<ShelfVisibilityState> state(&state_.visibility_state,
1195 SHELF_HIDDEN); 1196 SHELF_HIDDEN);
1196 TargetBounds target_bounds; 1197 TargetBounds target_bounds;
1197 CalculateTargetBounds(state_, &target_bounds); 1198 CalculateTargetBounds(state_, &target_bounds);
1198 UpdateBoundsAndOpacity(target_bounds, true, NULL); 1199 UpdateBoundsAndOpacity(target_bounds, true, NULL);
1199 UpdateVisibilityState(); 1200 UpdateVisibilityState();
1200 } 1201 }
1201 } 1202 }
1202 1203
1203 } // namespace ash 1204 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698