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

Unified Diff: chrome/browser/ui/views/tabs/tab_drag_controller2.cc

Issue 10021029: Propagate OnNativeWidgetMove to delegate/observers, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add/remove anchor observer OnWidgetVisibilityChanged; clear anchor_view_ OnWidgetClosing. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller2.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_drag_controller2.cc
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller2.cc b/chrome/browser/ui/views/tabs/tab_drag_controller2.cc
index e8ad2e37fb97103a503e8dd37bec02dfe497d3d9..a5b038bf0eab8ef12a81792f9735af5518c98f84 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller2.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller2.cc
@@ -38,7 +38,6 @@
#include "ui/gfx/screen.h"
#include "ui/views/events/event.h"
#include "ui/views/widget/root_view.h"
-#include "ui/views/widget/widget.h"
#if defined(USE_ASH)
#include "ash/wm/property_util.h"
@@ -327,9 +326,9 @@ TabDragController2::~TabDragController2() {
*destroyed_ = true;
if (move_loop_browser_view_) {
- move_loop_browser_view_->set_move_observer(NULL);
- SetTrackedByWorkspace(
- move_loop_browser_view_->GetWidget()->GetNativeView(), true);
+ views::Widget* browser_widget = move_loop_browser_view_->GetWidget();
+ browser_widget->RemoveObserver(this);
+ SetTrackedByWorkspace(browser_widget->GetNativeView(), true);
}
if (source_tabstrip_)
@@ -467,7 +466,7 @@ void TabDragController2::DidProcessEvent(const base::NativeEvent& event) {
}
#endif
-void TabDragController2::OnWidgetMoved() {
+void TabDragController2::OnWidgetMove(views::Widget* widget) {
Drag();
}
@@ -603,7 +602,7 @@ void TabDragController2::ContinueDragging() {
// ReleaseMouseCapture() is going to result in calling back to us (because
// it results in a move). That'll cause all sorts of problems. Reset the
// observer so we don't get notified and process the event.
- move_loop_browser_view_->set_move_observer(NULL);
+ move_loop_browser_view_->GetWidget()->RemoveObserver(this);
Ben Goodger (Google) 2012/04/18 15:56:48 Now that the only usage of |move_loop_browser_view
msw 2012/04/18 20:02:48 Done.
move_loop_browser_view_ = NULL;
#endif
BrowserView* browser_view = GetAttachedBrowserView();
@@ -984,7 +983,7 @@ void TabDragController2::DetachIntoNewBrowserAndRunMoveLoop(
void TabDragController2::RunMoveLoop() {
move_loop_browser_view_ = GetAttachedBrowserView();
DCHECK(move_loop_browser_view_);
- move_loop_browser_view_->set_move_observer(this);
+ move_loop_browser_view_->GetWidget()->AddObserver(this);
is_dragging_window_ = true;
bool destroyed = false;
destroyed_ = &destroyed;
@@ -1006,7 +1005,7 @@ void TabDragController2::RunMoveLoop() {
destroyed_ = NULL;
// Under chromeos we immediately set the |move_loop_browser_view_| to NULL.
if (move_loop_browser_view_) {
- move_loop_browser_view_->set_move_observer(NULL);
+ move_loop_browser_view_->GetWidget()->RemoveObserver(this);
move_loop_browser_view_ = NULL;
}
is_dragging_window_ = false;
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller2.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698