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

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 OVERRIDE 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
« no previous file with comments | « no previous file | chrome/app/generated_resources.grd » ('j') | ui/keyboard/keyboard_util.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 gfx::Insets(0, 0, GetWorkAreaSize(state, shelf_height), 0), 834 gfx::Insets(0, 0, GetWorkAreaSize(state, shelf_height), 0),
834 gfx::Insets(0, GetWorkAreaSize(state, shelf_width), 0, 0), 835 gfx::Insets(0, GetWorkAreaSize(state, shelf_width), 0, 0),
835 gfx::Insets(0, 0, 0, GetWorkAreaSize(state, shelf_width)), 836 gfx::Insets(0, 0, 0, GetWorkAreaSize(state, shelf_width)),
836 gfx::Insets(GetWorkAreaSize(state, shelf_height), 0, 0, 0)); 837 gfx::Insets(GetWorkAreaSize(state, shelf_height), 0, 0, 0));
837 838
838 // TODO(varkha): The functionality of managing insets for display areas 839 // TODO(varkha): The functionality of managing insets for display areas
839 // should probably be pushed to a separate component. This would simplify or 840 // should probably be pushed to a separate component. This would simplify or
840 // remove entirely the dependency on keyboard and dock. 841 // remove entirely the dependency on keyboard and dock.
841 842
842 // Also push in the work area inset for the keyboard if it is visible. 843 // Also push in the work area inset for the keyboard if it is visible.
843 if (!keyboard_bounds_.IsEmpty()) { 844 if (!keyboard_bounds_.IsEmpty() && !keyboard::IsKeyboardOverscrollEnabled()) {
844 gfx::Insets keyboard_insets(0, 0, keyboard_bounds_.height(), 0); 845 gfx::Insets keyboard_insets(0, 0, keyboard_bounds_.height(), 0);
845 target_bounds->work_area_insets += keyboard_insets; 846 target_bounds->work_area_insets += keyboard_insets;
846 } 847 }
847 848
848 // Also push in the work area inset for the dock if it is visible. 849 // Also push in the work area inset for the dock if it is visible.
849 if (!dock_bounds_.IsEmpty()) { 850 if (!dock_bounds_.IsEmpty()) {
850 gfx::Insets dock_insets( 851 gfx::Insets dock_insets(
851 0, (dock_bounds_.x() > 0 ? 0 : dock_bounds_.width()), 852 0, (dock_bounds_.x() > 0 ? 0 : dock_bounds_.width()),
852 0, (dock_bounds_.x() > 0 ? dock_bounds_.width() : 0)); 853 0, (dock_bounds_.x() > 0 ? dock_bounds_.width() : 0));
853 target_bounds->work_area_insets += dock_insets; 854 target_bounds->work_area_insets += dock_insets;
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 1179
1179 void ShelfLayoutManager::SessionStateChanged( 1180 void ShelfLayoutManager::SessionStateChanged(
1180 SessionStateDelegate::SessionState state) { 1181 SessionStateDelegate::SessionState state) {
1181 TargetBounds target_bounds; 1182 TargetBounds target_bounds;
1182 CalculateTargetBounds(state_, &target_bounds); 1183 CalculateTargetBounds(state_, &target_bounds);
1183 UpdateBoundsAndOpacity(target_bounds, true, NULL); 1184 UpdateBoundsAndOpacity(target_bounds, true, NULL);
1184 UpdateVisibilityState(); 1185 UpdateVisibilityState();
1185 } 1186 }
1186 1187
1187 } // namespace ash 1188 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/app/generated_resources.grd » ('j') | ui/keyboard/keyboard_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698