| 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/tabs/dragged_tab_controller.h" | 5 #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 public: | 196 public: |
| 197 DockDisplayer(DraggedTabController* controller, | 197 DockDisplayer(DraggedTabController* controller, |
| 198 const DockInfo& info) | 198 const DockInfo& info) |
| 199 : controller_(controller), | 199 : controller_(controller), |
| 200 popup_(NULL), | 200 popup_(NULL), |
| 201 popup_view_(NULL), | 201 popup_view_(NULL), |
| 202 ALLOW_THIS_IN_INITIALIZER_LIST(animation_(this)), | 202 ALLOW_THIS_IN_INITIALIZER_LIST(animation_(this)), |
| 203 hidden_(false), | 203 hidden_(false), |
| 204 in_enable_area_(info.in_enable_area()) { | 204 in_enable_area_(info.in_enable_area()) { |
| 205 #if defined(OS_WIN) | 205 #if defined(OS_WIN) |
| 206 popup_ = views::Widget::CreateWidget(); |
| 207 popup_->SetOpacity(0x00); |
| 206 // TODO(sky): This should "just work" on Gtk now. | 208 // TODO(sky): This should "just work" on Gtk now. |
| 207 views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); | 209 views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); |
| 208 params.transparent = true; | 210 params.transparent = true; |
| 209 params.keep_on_top = true; | 211 params.keep_on_top = true; |
| 210 popup_ = views::Widget::CreateWidget(params); | 212 params.bounds = info.GetPopupRect(); |
| 211 popup_->SetOpacity(0x00); | 213 popup_->Init(params); |
| 212 popup_->Init(NULL, info.GetPopupRect()); | |
| 213 popup_->SetContentsView(new DockView(info.type())); | 214 popup_->SetContentsView(new DockView(info.type())); |
| 214 if (info.in_enable_area()) | 215 if (info.in_enable_area()) |
| 215 animation_.Reset(1); | 216 animation_.Reset(1); |
| 216 else | 217 else |
| 217 animation_.Show(); | 218 animation_.Show(); |
| 218 popup_->Show(); | 219 popup_->Show(); |
| 219 #else | 220 #else |
| 220 NOTIMPLEMENTED(); | 221 NOTIMPLEMENTED(); |
| 221 #endif | 222 #endif |
| 222 popup_view_ = popup_->GetNativeView(); | 223 popup_view_ = popup_->GetNativeView(); |
| (...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1454 | 1455 |
| 1455 bool DraggedTabController::AreTabsConsecutive() { | 1456 bool DraggedTabController::AreTabsConsecutive() { |
| 1456 for (size_t i = 1; i < drag_data_.size(); ++i) { | 1457 for (size_t i = 1; i < drag_data_.size(); ++i) { |
| 1457 if (drag_data_[i - 1].source_model_index + 1 != | 1458 if (drag_data_[i - 1].source_model_index + 1 != |
| 1458 drag_data_[i].source_model_index) { | 1459 drag_data_[i].source_model_index) { |
| 1459 return false; | 1460 return false; |
| 1460 } | 1461 } |
| 1461 } | 1462 } |
| 1462 return true; | 1463 return true; |
| 1463 } | 1464 } |
| OLD | NEW |