Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: chrome/browser/ui/views/tabs/dragged_tab_controller.cc

Issue 6881107: Rework the way Widget::Init works: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tab_contents/tab_contents_view_gtk.cc ('k') | chrome/browser/ui/views/tabs/dragged_tab_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698