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/dragged_tab_view.h" | 5 #include "chrome/browser/ui/views/tabs/dragged_tab_view.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "chrome/browser/ui/views/tabs/native_view_photobooth.h" | 8 #include "chrome/browser/ui/views/tabs/native_view_photobooth.h" |
9 #include "third_party/skia/include/core/SkShader.h" | 9 #include "third_party/skia/include/core/SkShader.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 x = screen_point.x() - ScaleValue(mouse_tab_offset_.x()); | 79 x = screen_point.x() - ScaleValue(mouse_tab_offset_.x()); |
80 } | 80 } |
81 int y = screen_point.y() - ScaleValue(mouse_tab_offset_.y()); | 81 int y = screen_point.y() - ScaleValue(mouse_tab_offset_.y()); |
82 | 82 |
83 #if defined(OS_WIN) && !defined(USE_AURA) | 83 #if defined(OS_WIN) && !defined(USE_AURA) |
84 // TODO(beng): make this cross-platform | 84 // TODO(beng): make this cross-platform |
85 int show_flags = container_->IsVisible() ? SWP_NOZORDER : SWP_SHOWWINDOW; | 85 int show_flags = container_->IsVisible() ? SWP_NOZORDER : SWP_SHOWWINDOW; |
86 SetWindowPos(container_->GetNativeView(), HWND_TOP, x, y, 0, 0, | 86 SetWindowPos(container_->GetNativeView(), HWND_TOP, x, y, 0, 0, |
87 SWP_NOSIZE | SWP_NOACTIVATE | show_flags); | 87 SWP_NOSIZE | SWP_NOACTIVATE | show_flags); |
88 #else | 88 #else |
89 gfx::Rect bounds = container_->GetWindowScreenBounds(); | 89 gfx::Rect bounds = container_->GetWindowBoundsInScreen(); |
90 container_->SetBounds(gfx::Rect(x, y, bounds.width(), bounds.height())); | 90 container_->SetBounds(gfx::Rect(x, y, bounds.width(), bounds.height())); |
91 if (!container_->IsVisible()) | 91 if (!container_->IsVisible()) |
92 container_->Show(); | 92 container_->Show(); |
93 #endif | 93 #endif |
94 } | 94 } |
95 | 95 |
96 void DraggedTabView::Update() { | 96 void DraggedTabView::Update() { |
97 SchedulePaint(); | 97 SchedulePaint(); |
98 } | 98 } |
99 | 99 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 } | 186 } |
187 | 187 |
188 gfx::Size DraggedTabView::PreferredContainerSize() { | 188 gfx::Size DraggedTabView::PreferredContainerSize() { |
189 gfx::Size ps = GetPreferredSize(); | 189 gfx::Size ps = GetPreferredSize(); |
190 return gfx::Size(ScaleValue(ps.width()), ScaleValue(ps.height())); | 190 return gfx::Size(ScaleValue(ps.width()), ScaleValue(ps.height())); |
191 } | 191 } |
192 | 192 |
193 int DraggedTabView::ScaleValue(int value) { | 193 int DraggedTabView::ScaleValue(int value) { |
194 return static_cast<int>(value * kScalingFactor); | 194 return static_cast<int>(value * kScalingFactor); |
195 } | 195 } |
OLD | NEW |