| 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/tabs/tab_strip.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windowsx.h> | 8 #include <windowsx.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 2306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2317 resize_layout_timer_.Start( | 2317 resize_layout_timer_.Start( |
| 2318 FROM_HERE, base::TimeDelta::FromMilliseconds(kTouchResizeLayoutTimeMS), | 2318 FROM_HERE, base::TimeDelta::FromMilliseconds(kTouchResizeLayoutTimeMS), |
| 2319 this, &TabStrip::ResizeLayoutTabsFromTouch); | 2319 this, &TabStrip::ResizeLayoutTabsFromTouch); |
| 2320 } | 2320 } |
| 2321 | 2321 |
| 2322 void TabStrip::SetTabBoundsForDrag(const std::vector<gfx::Rect>& tab_bounds) { | 2322 void TabStrip::SetTabBoundsForDrag(const std::vector<gfx::Rect>& tab_bounds) { |
| 2323 StopAnimating(false); | 2323 StopAnimating(false); |
| 2324 DCHECK_EQ(tab_count(), static_cast<int>(tab_bounds.size())); | 2324 DCHECK_EQ(tab_count(), static_cast<int>(tab_bounds.size())); |
| 2325 for (int i = 0; i < tab_count(); ++i) | 2325 for (int i = 0; i < tab_count(); ++i) |
| 2326 tab_at(i)->SetBoundsRect(tab_bounds[i]); | 2326 tab_at(i)->SetBoundsRect(tab_bounds[i]); |
| 2327 // Reset the layout size as we've effectively layed out a different size. |
| 2328 // This ensures a layout happens after the drag is done. |
| 2329 last_layout_size_ = gfx::Size(); |
| 2327 } | 2330 } |
| 2328 | 2331 |
| 2329 void TabStrip::AddMessageLoopObserver() { | 2332 void TabStrip::AddMessageLoopObserver() { |
| 2330 if (!mouse_watcher_.get()) { | 2333 if (!mouse_watcher_.get()) { |
| 2331 mouse_watcher_.reset( | 2334 mouse_watcher_.reset( |
| 2332 new views::MouseWatcher( | 2335 new views::MouseWatcher( |
| 2333 new views::MouseWatcherViewHost( | 2336 new views::MouseWatcherViewHost( |
| 2334 this, gfx::Insets(0, 0, kTabStripAnimationVSlop, 0)), | 2337 this, gfx::Insets(0, 0, kTabStripAnimationVSlop, 0)), |
| 2335 this)); | 2338 this)); |
| 2336 } | 2339 } |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2775 #if defined(USE_AURA) | 2778 #if defined(USE_AURA) |
| 2776 return chrome::GetHostDesktopTypeForNativeView( | 2779 return chrome::GetHostDesktopTypeForNativeView( |
| 2777 GetWidget()->GetNativeView()) == chrome::HOST_DESKTOP_TYPE_ASH; | 2780 GetWidget()->GetNativeView()) == chrome::HOST_DESKTOP_TYPE_ASH; |
| 2778 #else | 2781 #else |
| 2779 if (ui::GetDisplayLayout() != ui::LAYOUT_TOUCH) | 2782 if (ui::GetDisplayLayout() != ui::LAYOUT_TOUCH) |
| 2780 return false; | 2783 return false; |
| 2781 #endif | 2784 #endif |
| 2782 | 2785 |
| 2783 return true; | 2786 return true; |
| 2784 } | 2787 } |
| OLD | NEW |