| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/constrained_window.h" | 10 #include "chrome/browser/ui/constrained_window.h" |
| 11 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 11 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
| 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 13 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view.h" | 13 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view.h" |
| 14 #include "chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h" | 14 #include "chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h" |
| 15 #include "content/browser/renderer_host/render_view_host.h" | 15 #include "content/browser/renderer_host/render_view_host.h" |
| 16 #include "content/browser/renderer_host/render_view_host_factory.h" | 16 #include "content/browser/renderer_host/render_view_host_factory.h" |
| 17 #include "content/browser/renderer_host/render_widget_host_view.h" | |
| 18 #include "content/public/browser/interstitial_page.h" | 17 #include "content/public/browser/interstitial_page.h" |
| 19 #include "content/public/browser/render_process_host.h" | 18 #include "content/public/browser/render_process_host.h" |
| 19 #include "content/public/browser/render_widget_host_view.h" |
| 20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 21 #include "content/public/browser/web_contents_delegate.h" | 21 #include "content/public/browser/web_contents_delegate.h" |
| 22 #include "ui/gfx/screen.h" | 22 #include "ui/gfx/screen.h" |
| 23 #include "ui/views/focus/focus_manager.h" | 23 #include "ui/views/focus/focus_manager.h" |
| 24 #include "ui/views/focus/view_storage.h" | 24 #include "ui/views/focus/view_storage.h" |
| 25 #include "ui/views/widget/native_widget.h" | 25 #include "ui/views/widget/native_widget.h" |
| 26 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
| 27 | 27 |
| 28 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
| 29 #include <windows.h> | 29 #include <windows.h> |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 using WebKit::WebDragOperation; | 32 using WebKit::WebDragOperation; |
| 33 using WebKit::WebDragOperationNone; | 33 using WebKit::WebDragOperationNone; |
| 34 using WebKit::WebDragOperationsMask; | 34 using WebKit::WebDragOperationsMask; |
| 35 using WebKit::WebInputEvent; | 35 using WebKit::WebInputEvent; |
| 36 using content::RenderWidgetHostView; |
| 36 using content::WebContents; | 37 using content::WebContents; |
| 37 | 38 |
| 38 TabContentsViewViews::TabContentsViewViews(WebContents* web_contents) | 39 TabContentsViewViews::TabContentsViewViews(WebContents* web_contents) |
| 39 : web_contents_(web_contents), | 40 : web_contents_(web_contents), |
| 40 native_tab_contents_view_(NULL), | 41 native_tab_contents_view_(NULL), |
| 41 close_tab_after_drag_ends_(false), | 42 close_tab_after_drag_ends_(false), |
| 42 focus_manager_(NULL), | 43 focus_manager_(NULL), |
| 43 overlaid_view_(NULL) { | 44 overlaid_view_(NULL) { |
| 44 last_focused_view_storage_id_ = | 45 last_focused_view_storage_id_ = |
| 45 views::ViewStorage::GetInstance()->CreateStorageID(); | 46 views::ViewStorage::GetInstance()->CreateStorageID(); |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 web_contents_->HideContents(); | 469 web_contents_->HideContents(); |
| 469 } | 470 } |
| 470 } | 471 } |
| 471 | 472 |
| 472 void TabContentsViewViews::OnNativeWidgetSizeChanged( | 473 void TabContentsViewViews::OnNativeWidgetSizeChanged( |
| 473 const gfx::Size& new_size) { | 474 const gfx::Size& new_size) { |
| 474 if (overlaid_view_) | 475 if (overlaid_view_) |
| 475 overlaid_view_->SetBounds(gfx::Rect(new_size)); | 476 overlaid_view_->SetBounds(gfx::Rect(new_size)); |
| 476 views::Widget::OnNativeWidgetSizeChanged(new_size); | 477 views::Widget::OnNativeWidgetSizeChanged(new_size); |
| 477 } | 478 } |
| OLD | NEW |