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

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

Issue 143023003: Fully support the autohide shelf option for touch UI on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 6 years, 10 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 | « ash/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_layout_manager_unittest.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 (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>
11 #include <vector> 11 #include <vector>
12 12
13 #include "ash/accelerators/accelerator_commands.h"
13 #include "ash/ash_switches.h" 14 #include "ash/ash_switches.h"
14 #include "ash/root_window_controller.h" 15 #include "ash/root_window_controller.h"
15 #include "ash/screen_util.h" 16 #include "ash/screen_util.h"
16 #include "ash/session_state_delegate.h" 17 #include "ash/session_state_delegate.h"
17 #include "ash/shelf/shelf.h" 18 #include "ash/shelf/shelf.h"
18 #include "ash/shelf/shelf_bezel_event_filter.h" 19 #include "ash/shelf/shelf_bezel_event_filter.h"
19 #include "ash/shelf/shelf_constants.h" 20 #include "ash/shelf/shelf_constants.h"
20 #include "ash/shelf/shelf_layout_manager_observer.h" 21 #include "ash/shelf/shelf_layout_manager_observer.h"
21 #include "ash/shelf/shelf_widget.h" 22 #include "ash/shelf/shelf_widget.h"
22 #include "ash/shell.h" 23 #include "ash/shell.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 383
383 void ShelfLayoutManager::AddObserver(ShelfLayoutManagerObserver* observer) { 384 void ShelfLayoutManager::AddObserver(ShelfLayoutManagerObserver* observer) {
384 observers_.AddObserver(observer); 385 observers_.AddObserver(observer);
385 } 386 }
386 387
387 void ShelfLayoutManager::RemoveObserver(ShelfLayoutManagerObserver* observer) { 388 void ShelfLayoutManager::RemoveObserver(ShelfLayoutManagerObserver* observer) {
388 observers_.RemoveObserver(observer); 389 observers_.RemoveObserver(observer);
389 } 390 }
390 391
391 //////////////////////////////////////////////////////////////////////////////// 392 ////////////////////////////////////////////////////////////////////////////////
392 // ShelfLayoutManager, Gesture dragging: 393 // ShelfLayoutManager, Gesture functions:
394
395 void ShelfLayoutManager::OnGestureEdgeSwipe(const ui::GestureEvent& gesture) {
396 // Edge swipe should exit fullscreen, show the tray, and disable auto-hide.
397
398 if (workspace_controller_->GetWindowState() ==
399 WORKSPACE_WINDOW_STATE_FULL_SCREEN) {
400 accelerators::ToggleFullscreen();
401 }
402
403 ShelfVisibilityState visibility = CalculateShelfVisibility();
404 if (visibility == SHELF_AUTO_HIDE &&
405 CalculateAutoHideState(visibility) == SHELF_AUTO_HIDE_HIDDEN) {
406 SetState(SHELF_VISIBLE);
407 SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
408 }
409 }
393 410
394 void ShelfLayoutManager::StartGestureDrag(const ui::GestureEvent& gesture) { 411 void ShelfLayoutManager::StartGestureDrag(const ui::GestureEvent& gesture) {
395 gesture_drag_status_ = GESTURE_DRAG_IN_PROGRESS; 412 gesture_drag_status_ = GESTURE_DRAG_IN_PROGRESS;
396 gesture_drag_amount_ = 0.f; 413 gesture_drag_amount_ = 0.f;
397 gesture_drag_auto_hide_state_ = visibility_state() == SHELF_AUTO_HIDE ? 414 gesture_drag_auto_hide_state_ = visibility_state() == SHELF_AUTO_HIDE ?
398 auto_hide_state() : SHELF_AUTO_HIDE_SHOWN; 415 auto_hide_state() : SHELF_AUTO_HIDE_SHOWN;
399 UpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE); 416 UpdateShelfBackground(BACKGROUND_CHANGE_ANIMATE);
400 } 417 }
401 418
402 ShelfLayoutManager::DragState ShelfLayoutManager::UpdateGestureDrag( 419 ShelfLayoutManager::DragState ShelfLayoutManager::UpdateGestureDrag(
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 return gfx::Insets(0, distance, 0, 0); 1167 return gfx::Insets(0, distance, 0, 0);
1151 case SHELF_ALIGNMENT_TOP: 1168 case SHELF_ALIGNMENT_TOP:
1152 return gfx::Insets(0, 0, distance, 0); 1169 return gfx::Insets(0, 0, distance, 0);
1153 } 1170 }
1154 NOTREACHED(); 1171 NOTREACHED();
1155 return gfx::Insets(); 1172 return gfx::Insets();
1156 } 1173 }
1157 1174
1158 } // namespace internal 1175 } // namespace internal
1159 } // namespace ash 1176 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/shelf/shelf_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698