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

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: Fix copyright notice. Created 6 years, 9 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 internal { 54 namespace internal {
54 55
55 namespace { 56 namespace {
56 57
57 // Delay before showing the shelf. This is after the mouse stops moving. 58 // Delay before showing the shelf. This is after the mouse stops moving.
58 const int kAutoHideDelayMS = 200; 59 const int kAutoHideDelayMS = 200;
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 gfx::Insets(0, 0, GetWorkAreaSize(state, shelf_height), 0), 838 gfx::Insets(0, 0, GetWorkAreaSize(state, shelf_height), 0),
838 gfx::Insets(0, GetWorkAreaSize(state, shelf_width), 0, 0), 839 gfx::Insets(0, GetWorkAreaSize(state, shelf_width), 0, 0),
839 gfx::Insets(0, 0, 0, GetWorkAreaSize(state, shelf_width)), 840 gfx::Insets(0, 0, 0, GetWorkAreaSize(state, shelf_width)),
840 gfx::Insets(GetWorkAreaSize(state, shelf_height), 0, 0, 0)); 841 gfx::Insets(GetWorkAreaSize(state, shelf_height), 0, 0, 0));
841 842
842 // TODO(varkha): The functionality of managing insets for display areas 843 // TODO(varkha): The functionality of managing insets for display areas
843 // should probably be pushed to a separate component. This would simplify or 844 // should probably be pushed to a separate component. This would simplify or
844 // remove entirely the dependency on keyboard and dock. 845 // remove entirely the dependency on keyboard and dock.
845 846
846 // Also push in the work area inset for the keyboard if it is visible. 847 // Also push in the work area inset for the keyboard if it is visible.
847 if (!keyboard_bounds_.IsEmpty()) { 848 if (!keyboard_bounds_.IsEmpty() && !keyboard::IsKeyboardOverscrollEnabled()) {
848 gfx::Insets keyboard_insets(0, 0, keyboard_bounds_.height(), 0); 849 gfx::Insets keyboard_insets(0, 0, keyboard_bounds_.height(), 0);
849 target_bounds->work_area_insets += keyboard_insets; 850 target_bounds->work_area_insets += keyboard_insets;
850 } 851 }
851 852
852 // Also push in the work area inset for the dock if it is visible. 853 // Also push in the work area inset for the dock if it is visible.
853 if (!dock_bounds_.IsEmpty()) { 854 if (!dock_bounds_.IsEmpty()) {
854 gfx::Insets dock_insets( 855 gfx::Insets dock_insets(
855 0, (dock_bounds_.x() > 0 ? 0 : dock_bounds_.width()), 856 0, (dock_bounds_.x() > 0 ? 0 : dock_bounds_.width()),
856 0, (dock_bounds_.x() > 0 ? dock_bounds_.width() : 0)); 857 0, (dock_bounds_.x() > 0 ? dock_bounds_.width() : 0));
857 target_bounds->work_area_insets += dock_insets; 858 target_bounds->work_area_insets += dock_insets;
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 SHELF_HIDDEN); 1180 SHELF_HIDDEN);
1180 TargetBounds target_bounds; 1181 TargetBounds target_bounds;
1181 CalculateTargetBounds(state_, &target_bounds); 1182 CalculateTargetBounds(state_, &target_bounds);
1182 UpdateBoundsAndOpacity(target_bounds, true, NULL); 1183 UpdateBoundsAndOpacity(target_bounds, true, NULL);
1183 UpdateVisibilityState(); 1184 UpdateVisibilityState();
1184 } 1185 }
1185 } 1186 }
1186 1187
1187 } // namespace internal 1188 } // namespace internal
1188 } // namespace ash 1189 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698