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