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

Unified Diff: athena/wm/split_view_controller.cc

Issue 694883002: Do not allow split view to be engaged by a bezel gesture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/wm/split_view_controller.h ('k') | athena/wm/window_manager_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/wm/split_view_controller.cc
diff --git a/athena/wm/split_view_controller.cc b/athena/wm/split_view_controller.cc
index c20a873d81194b620d817bbdd8b1ef21e1599837..23813ad718624aead26961d7e2936d2c0ad2395d 100644
--- a/athena/wm/split_view_controller.cc
+++ b/athena/wm/split_view_controller.cc
@@ -555,45 +555,17 @@ float SplitViewController::GetMinFlingVelocityForTest() const {
}
///////////////////////////////////////////////////////////////////////////////
-// BezelController::ScrollDelegate:
-
-void SplitViewController::BezelScrollBegin(BezelController::Bezel bezel,
- float delta) {
- if (!BezelCanScroll())
- return;
-
- SetState(SCROLLING);
-
- const aura::Window::Windows& windows = window_list_provider_->GetWindowList();
- CHECK(windows.size() >= 2);
- aura::Window::Windows::const_reverse_iterator iter = windows.rbegin();
- aura::Window* current_window = *(iter);
-
- if (delta > 0) {
- right_window_ = current_window;
- left_window_ = *(iter + 1);
- } else {
- left_window_ = current_window;
- right_window_ = *(iter + 1);
- }
-
- CHECK(left_window_);
- CHECK(right_window_);
-
- // Calculate divider_scroll_start_position_
- gfx::Screen* screen = gfx::Screen::GetScreenFor(container_);
- const gfx::Rect& display_bounds =
- screen->GetDisplayNearestWindow(container_).bounds();
- gfx::Rect container_bounds = container_->GetBoundsInScreen();
- divider_scroll_start_position_ =
- delta > 0 ? display_bounds.x() - container_bounds.x()
- : display_bounds.right() - container_bounds.x();
+// DragHandleScrollDelegate:
+void SplitViewController::HandleScrollBegin(float delta) {
+ CHECK(state_ == ACTIVE);
+ state_ = SCROLLING;
+ divider_scroll_start_position_ = GetDefaultDividerPosition();
divider_position_ = divider_scroll_start_position_ + delta;
UpdateLayout(false);
}
-void SplitViewController::BezelScrollEnd(float velocity) {
+void SplitViewController::HandleScrollEnd(float velocity) {
if (state_ != SCROLLING)
return;
@@ -624,36 +596,13 @@ void SplitViewController::BezelScrollEnd(float velocity) {
UpdateLayout(true);
}
-void SplitViewController::BezelScrollUpdate(float delta) {
+void SplitViewController::HandleScrollUpdate(float delta) {
if (state_ != SCROLLING)
return;
divider_position_ = divider_scroll_start_position_ + delta;
UpdateLayout(false);
}
-bool SplitViewController::BezelCanScroll() {
- return CanActivateSplitViewMode();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// DragHandleScrollDelegate:
-
-void SplitViewController::HandleScrollBegin(float delta) {
- CHECK(state_ == ACTIVE);
- state_ = SCROLLING;
- divider_scroll_start_position_ = GetDefaultDividerPosition();
- divider_position_ = divider_scroll_start_position_ + delta;
- UpdateLayout(false);
-}
-
-void SplitViewController::HandleScrollEnd(float velocity) {
- BezelScrollEnd(velocity);
-}
-
-void SplitViewController::HandleScrollUpdate(float delta) {
- BezelScrollUpdate(delta);
-}
-
///////////////////////////////////////////////////////////////////////////////
// WindowManagerObserver:
« no previous file with comments | « athena/wm/split_view_controller.h ('k') | athena/wm/window_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698