| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
| 27 #include <windows.h> | 27 #include <windows.h> |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 using WebKit::WebDragOperation; | 30 using WebKit::WebDragOperation; |
| 31 using WebKit::WebDragOperationNone; | 31 using WebKit::WebDragOperationNone; |
| 32 using WebKit::WebDragOperationsMask; | 32 using WebKit::WebDragOperationsMask; |
| 33 using WebKit::WebInputEvent; | 33 using WebKit::WebInputEvent; |
| 34 | 34 |
| 35 // static | |
| 36 TabContentsView* TabContentsView::Create(TabContents* tab_contents) { | |
| 37 return new TabContentsViewViews(tab_contents); | |
| 38 } | |
| 39 | |
| 40 TabContentsViewViews::TabContentsViewViews(TabContents* tab_contents) | 35 TabContentsViewViews::TabContentsViewViews(TabContents* tab_contents) |
| 41 : tab_contents_(tab_contents), | 36 : tab_contents_(tab_contents), |
| 42 native_tab_contents_view_(NULL), | 37 native_tab_contents_view_(NULL), |
| 43 sad_tab_(NULL), | 38 sad_tab_(NULL), |
| 44 close_tab_after_drag_ends_(false), | 39 close_tab_after_drag_ends_(false), |
| 45 focus_manager_(NULL) { | 40 focus_manager_(NULL) { |
| 46 last_focused_view_storage_id_ = | 41 last_focused_view_storage_id_ = |
| 47 views::ViewStorage::GetInstance()->CreateStorageID(); | 42 views::ViewStorage::GetInstance()->CreateStorageID(); |
| 48 } | 43 } |
| 49 | 44 |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 focus_manager_ = NULL; | 407 focus_manager_ = NULL; |
| 413 return focus_manager; | 408 return focus_manager; |
| 414 } | 409 } |
| 415 // 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 |
| 416 // 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 |
| 417 // probably have an empty TabContentView implementation for the unit-tests, | 412 // probably have an empty TabContentView implementation for the unit-tests, |
| 418 // 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. |
| 419 // DCHECK(focus_manager_); | 414 // DCHECK(focus_manager_); |
| 420 return focus_manager_; | 415 return focus_manager_; |
| 421 } | 416 } |
| OLD | NEW |