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

Side by Side Diff: chrome/browser/ui/views/tabs/dragged_tab_controller.cc

Issue 6507028: Remove usages of RootView from View by moving relevant RootView API methods t... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/tabs/dragged_tab_controller.h" 5 #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 // otherwise our dragged_contents() may be replaced and subsequently 609 // otherwise our dragged_contents() may be replaced and subsequently
610 // collected/destroyed while the drag is in process, leading to 610 // collected/destroyed while the drag is in process, leading to
611 // nasty crashes. 611 // nasty crashes.
612 original_delegate_ = dragged_contents_->tab_contents()->delegate(); 612 original_delegate_ = dragged_contents_->tab_contents()->delegate();
613 dragged_contents_->tab_contents()->set_delegate(this); 613 dragged_contents_->tab_contents()->set_delegate(this);
614 } 614 }
615 } 615 }
616 616
617 void DraggedTabController::SaveFocus() { 617 void DraggedTabController::SaveFocus() {
618 if (!old_focused_view_) { 618 if (!old_focused_view_) {
619 old_focused_view_ = source_tabstrip_->GetRootView()->GetFocusedView(); 619 old_focused_view_ = source_tabstrip_->GetFocusManager()->GetFocusedView();
620 source_tabstrip_->GetRootView()->FocusView(source_tabstrip_); 620 source_tabstrip_->GetFocusManager()->SetFocusedView(source_tabstrip_);
621 } 621 }
622 } 622 }
623 623
624 void DraggedTabController::RestoreFocus() { 624 void DraggedTabController::RestoreFocus() {
625 if (old_focused_view_ && attached_tabstrip_ == source_tabstrip_) 625 if (old_focused_view_ && attached_tabstrip_ == source_tabstrip_)
626 old_focused_view_->GetRootView()->FocusView(old_focused_view_); 626 old_focused_view_->GetFocusManager()->SetFocusedView(old_focused_view_);
627 old_focused_view_ = NULL; 627 old_focused_view_ = NULL;
628 } 628 }
629 629
630 bool DraggedTabController::CanStartDrag() const { 630 bool DraggedTabController::CanStartDrag() const {
631 // Determine if the mouse has moved beyond a minimum elasticity distance in 631 // Determine if the mouse has moved beyond a minimum elasticity distance in
632 // any direction from the starting point. 632 // any direction from the starting point.
633 static const int kMinimumDragDistance = 10; 633 static const int kMinimumDragDistance = 10;
634 gfx::Point screen_point = GetCursorScreenPoint(); 634 gfx::Point screen_point = GetCursorScreenPoint();
635 int x_offset = abs(screen_point.x() - start_screen_point_.x()); 635 int x_offset = abs(screen_point.x() - start_screen_point_.x());
636 int y_offset = abs(screen_point.y() - start_screen_point_.y()); 636 int y_offset = abs(screen_point.y() - start_screen_point_.y());
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 #else 1349 #else
1350 NOTIMPLEMENTED(); 1350 NOTIMPLEMENTED();
1351 #endif 1351 #endif
1352 } 1352 }
1353 } 1353 }
1354 1354
1355 TabStripModel* DraggedTabController::GetModel(BaseTabStrip* tabstrip) const { 1355 TabStripModel* DraggedTabController::GetModel(BaseTabStrip* tabstrip) const {
1356 return static_cast<BrowserTabStripController*>(tabstrip->controller())-> 1356 return static_cast<BrowserTabStripController*>(tabstrip->controller())->
1357 model(); 1357 model();
1358 } 1358 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc ('k') | views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698