| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // no longer be focusable (e.g. if the location bar was focused and then | 217 // no longer be focusable (e.g. if the location bar was focused and then |
| 218 // we switched to fullscreen mode). In that case we default to the | 218 // we switched to fullscreen mode). In that case we default to the |
| 219 // default focus. | 219 // default focus. |
| 220 SetInitialFocus(); | 220 SetInitialFocus(); |
| 221 } | 221 } |
| 222 view_storage->RemoveView(last_focused_view_storage_id_); | 222 view_storage->RemoveView(last_focused_view_storage_id_); |
| 223 } | 223 } |
| 224 } | 224 } |
| 225 | 225 |
| 226 void TabContentsViewViews::UpdatePreferredSize(const gfx::Size& pref_size) { | 226 void TabContentsViewViews::UpdatePreferredSize(const gfx::Size& pref_size) { |
| 227 tab_contents_->UpdatePreferredSize(pref_size); |
| 227 } | 228 } |
| 228 | 229 |
| 229 bool TabContentsViewViews::IsDoingDrag() const { | 230 bool TabContentsViewViews::IsDoingDrag() const { |
| 230 return native_tab_contents_view_->IsDoingDrag(); | 231 return native_tab_contents_view_->IsDoingDrag(); |
| 231 } | 232 } |
| 232 | 233 |
| 233 void TabContentsViewViews::CancelDragAndCloseTab() { | 234 void TabContentsViewViews::CancelDragAndCloseTab() { |
| 234 DCHECK(IsDoingDrag()); | 235 DCHECK(IsDoingDrag()); |
| 235 // We can't close the tab while we're in the drag and | 236 // We can't close the tab while we're in the drag and |
| 236 // |drag_handler_->CancelDrag()| is async. Instead, set a flag to cancel | 237 // |drag_handler_->CancelDrag()| is async. Instead, set a flag to cancel |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 focus_manager_ = NULL; | 411 focus_manager_ = NULL; |
| 411 return focus_manager; | 412 return focus_manager; |
| 412 } | 413 } |
| 413 // TODO(jcampan): we should DCHECK on focus_manager_, as it should not be | 414 // TODO(jcampan): we should DCHECK on focus_manager_, as it should not be |
| 414 // NULL. We are not doing it as it breaks some unit-tests. We should | 415 // NULL. We are not doing it as it breaks some unit-tests. We should |
| 415 // probably have an empty TabContentView implementation for the unit-tests, | 416 // probably have an empty TabContentView implementation for the unit-tests, |
| 416 // that would prevent that code being executed in the unit-test case. | 417 // that would prevent that code being executed in the unit-test case. |
| 417 // DCHECK(focus_manager_); | 418 // DCHECK(focus_manager_); |
| 418 return focus_manager_; | 419 return focus_manager_; |
| 419 } | 420 } |
| OLD | NEW |