| 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 19 matching lines...) Expand all Loading... |
| 30 const std::vector<gfx::Rect>& renderer_bounds, | 30 const std::vector<gfx::Rect>& renderer_bounds, |
| 31 const gfx::Point& mouse_tab_offset, | 31 const gfx::Point& mouse_tab_offset, |
| 32 const gfx::Size& contents_size, | 32 const gfx::Size& contents_size, |
| 33 NativeViewPhotobooth* photobooth) | 33 NativeViewPhotobooth* photobooth) |
| 34 : renderers_(renderers), | 34 : renderers_(renderers), |
| 35 renderer_bounds_(renderer_bounds), | 35 renderer_bounds_(renderer_bounds), |
| 36 show_contents_on_drag_(true), | 36 show_contents_on_drag_(true), |
| 37 mouse_tab_offset_(mouse_tab_offset), | 37 mouse_tab_offset_(mouse_tab_offset), |
| 38 photobooth_(photobooth), | 38 photobooth_(photobooth), |
| 39 contents_size_(contents_size) { | 39 contents_size_(contents_size) { |
| 40 set_parent_owned(false); | 40 set_owned_by_client(); |
| 41 | 41 |
| 42 container_.reset(new views::Widget); | 42 container_.reset(new views::Widget); |
| 43 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 43 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
| 44 params.transparent = true; | 44 params.transparent = true; |
| 45 params.keep_on_top = true; | 45 params.keep_on_top = true; |
| 46 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 46 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 47 params.bounds = gfx::Rect(PreferredContainerSize()); | 47 params.bounds = gfx::Rect(PreferredContainerSize()); |
| 48 container_->Init(params); | 48 container_->Init(params); |
| 49 container_->SetContentsView(this); | 49 container_->SetContentsView(this); |
| 50 #if defined(OS_WIN) && !defined(USE_AURA) | 50 #if defined(OS_WIN) && !defined(USE_AURA) |
| (...skipping 135 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 |