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

Side by Side Diff: chrome/browser/ui/views/ash/tab_scrubber.cc

Issue 2656983005: Fix the TabScrubber always starting from the first tab in full screen mode. (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/ui/views/ash/tab_scrubber.h" 5 #include "chrome/browser/ui/views/ash/tab_scrubber.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 void TabScrubber::BeginScrub(Browser* browser, 227 void TabScrubber::BeginScrub(Browser* browser,
228 BrowserView* browser_view, 228 BrowserView* browser_view,
229 float x_offset) { 229 float x_offset) {
230 DCHECK(browser); 230 DCHECK(browser);
231 DCHECK(browser_view); 231 DCHECK(browser_view);
232 232
233 scrubbing_ = true; 233 scrubbing_ = true;
234 browser_ = browser; 234 browser_ = browser;
235 tab_strip_ = browser_view->tabstrip(); 235 tab_strip_ = browser_view->tabstrip();
236 236
237 Direction direction = (x_offset < 0) ? LEFT : RIGHT; 237 // The browser's top view must be revealed first, before we attempt to get the
238 ScrubDirectionChanged(direction); 238 // start point, otherwise that tab's bounds we get in GetStartPoint() will be
239 239 // wrong.
James Cook 2017/01/27 23:21:27 nice comment
afakhry 2017/01/28 00:48:21 Thanks!
240 ImmersiveModeController* immersive_controller = 240 ImmersiveModeController* immersive_controller =
241 browser_view->immersive_mode_controller(); 241 browser_view->immersive_mode_controller();
242 if (immersive_controller->IsEnabled()) { 242 if (immersive_controller->IsEnabled()) {
243 immersive_reveal_lock_.reset(immersive_controller->GetRevealedLock( 243 immersive_reveal_lock_.reset(immersive_controller->GetRevealedLock(
244 ImmersiveModeController::ANIMATE_REVEAL_YES)); 244 ImmersiveModeController::ANIMATE_REVEAL_YES));
245 } 245 }
246 246
247 Direction direction = (x_offset < 0) ? LEFT : RIGHT;
248 ScrubDirectionChanged(direction);
249
247 tab_strip_->AddObserver(this); 250 tab_strip_->AddObserver(this);
248 } 251 }
249 252
250 void TabScrubber::FinishScrub(bool activate) { 253 void TabScrubber::FinishScrub(bool activate) {
251 activate_timer_.Stop(); 254 activate_timer_.Stop();
252 255
253 if (browser_ && browser_->window()) { 256 if (browser_ && browser_->window()) {
254 BrowserView* browser_view = 257 BrowserView* browser_view =
255 BrowserView::GetBrowserViewForNativeWindow( 258 BrowserView::GetBrowserViewForNativeWindow(
256 browser_->window()->GetNativeWindow()); 259 browser_->window()->GetNativeWindow());
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 tab->hover_controller()->HideImmediately(); 340 tab->hover_controller()->HideImmediately();
338 } 341 }
339 342
340 if (new_index != browser_->tab_strip_model()->active_index()) { 343 if (new_index != browser_->tab_strip_model()->active_index()) {
341 highlighted_tab_ = new_index; 344 highlighted_tab_ = new_index;
342 new_tab->hover_controller()->Show(views::GlowHoverController::PRONOUNCED); 345 new_tab->hover_controller()->Show(views::GlowHoverController::PRONOUNCED);
343 } else { 346 } else {
344 highlighted_tab_ = -1; 347 highlighted_tab_ = -1;
345 } 348 }
346 } 349 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698