| OLD | NEW |
| 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/tab_contents/tab_contents_view_views.h" | 5 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/ui/views/sad_tab_view.h" | 10 #include "chrome/browser/ui/views/sad_tab_view.h" |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // Let our delegate know that the mouse moved (useful for resetting status | 378 // Let our delegate know that the mouse moved (useful for resetting status |
| 379 // bubble state). | 379 // bubble state). |
| 380 if (tab_contents_->delegate()) { | 380 if (tab_contents_->delegate()) { |
| 381 tab_contents_->delegate()->ContentsMouseEvent( | 381 tab_contents_->delegate()->ContentsMouseEvent( |
| 382 tab_contents_, gfx::Screen::GetCursorScreenPoint(), motion); | 382 tab_contents_, gfx::Screen::GetCursorScreenPoint(), motion); |
| 383 } | 383 } |
| 384 } | 384 } |
| 385 | 385 |
| 386 void TabContentsViewViews::OnNativeTabContentsViewDraggingEnded() { | 386 void TabContentsViewViews::OnNativeTabContentsViewDraggingEnded() { |
| 387 if (close_tab_after_drag_ends_) { | 387 if (close_tab_after_drag_ends_) { |
| 388 close_tab_timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(0), | 388 close_tab_timer_.Start(base::TimeDelta::FromMilliseconds(0), this, |
| 389 this, &TabContentsViewViews::CloseTab); | 389 &TabContentsViewViews::CloseTab); |
| 390 } | 390 } |
| 391 tab_contents_->SystemDragEnded(); | 391 tab_contents_->SystemDragEnded(); |
| 392 } | 392 } |
| 393 | 393 |
| 394 views::internal::NativeWidgetDelegate* | 394 views::internal::NativeWidgetDelegate* |
| 395 TabContentsViewViews::AsNativeWidgetDelegate() { | 395 TabContentsViewViews::AsNativeWidgetDelegate() { |
| 396 return this; | 396 return this; |
| 397 } | 397 } |
| 398 | 398 |
| 399 //////////////////////////////////////////////////////////////////////////////// | 399 //////////////////////////////////////////////////////////////////////////////// |
| 400 // TabContentsViewViews, views::Widget overrides: | 400 // TabContentsViewViews, views::Widget overrides: |
| 401 | 401 |
| 402 views::FocusManager* TabContentsViewViews::GetFocusManager() { | 402 views::FocusManager* TabContentsViewViews::GetFocusManager() { |
| 403 views::FocusManager* focus_manager = Widget::GetFocusManager(); | 403 views::FocusManager* focus_manager = Widget::GetFocusManager(); |
| 404 if (focus_manager) { | 404 if (focus_manager) { |
| 405 // If focus_manager_ is non NULL, it means we have been reparented, in which | 405 // If focus_manager_ is non NULL, it means we have been reparented, in which |
| 406 // case its value may not be valid anymore. | 406 // case its value may not be valid anymore. |
| 407 focus_manager_ = NULL; | 407 focus_manager_ = NULL; |
| 408 return focus_manager; | 408 return focus_manager; |
| 409 } | 409 } |
| 410 // TODO(jcampan): we should DCHECK on focus_manager_, as it should not be | 410 // TODO(jcampan): we should DCHECK on focus_manager_, as it should not be |
| 411 // NULL. We are not doing it as it breaks some unit-tests. We should | 411 // NULL. We are not doing it as it breaks some unit-tests. We should |
| 412 // probably have an empty TabContentView implementation for the unit-tests, | 412 // probably have an empty TabContentView implementation for the unit-tests, |
| 413 // that would prevent that code being executed in the unit-test case. | 413 // that would prevent that code being executed in the unit-test case. |
| 414 // DCHECK(focus_manager_); | 414 // DCHECK(focus_manager_); |
| 415 return focus_manager_; | 415 return focus_manager_; |
| 416 } | 416 } |
| OLD | NEW |