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

Side by Side Diff: chrome/browser/views/tabs/tab_overview_drag_controller.cc

Issue 155006: Fix the Linux2 build. (Closed)
Patch Set: Created 11 years, 5 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
« no previous file with comments | « chrome/browser/views/tabs/tab_overview_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/views/tabs/tab_overview_drag_controller.h" 5 #include "chrome/browser/views/tabs/tab_overview_drag_controller.h"
6 6
7 #include "chrome/browser/browser.h" 7 #include "chrome/browser/browser.h"
8 #include "chrome/browser/browser_window.h" 8 #include "chrome/browser/browser_window.h"
9 #include "chrome/browser/dock_info.h" 9 #include "chrome/browser/dock_info.h"
10 #include "chrome/browser/gtk/browser_window_gtk.h" 10 #include "chrome/browser/gtk/browser_window_gtk.h"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 views::WidgetGtk* widget = 406 views::WidgetGtk* widget =
407 new views::WidgetGtk(views::WidgetGtk::TYPE_WINDOW); 407 new views::WidgetGtk(views::WidgetGtk::TYPE_WINDOW);
408 widget->MakeTransparent(); 408 widget->MakeTransparent();
409 gfx::Point screen_loc = location; 409 gfx::Point screen_loc = location;
410 screen_loc.Offset(-x_offset_, -y_offset_); 410 screen_loc.Offset(-x_offset_, -y_offset_);
411 grid()->ConvertPointToScreen(grid(), &screen_loc); 411 grid()->ConvertPointToScreen(grid(), &screen_loc);
412 TabOverviewCell* cell = new TabOverviewCell(); 412 TabOverviewCell* cell = new TabOverviewCell();
413 cell->set_preferred_size( 413 cell->set_preferred_size(
414 gfx::Size(grid()->cell_width(), grid()->cell_height())); 414 gfx::Size(grid()->cell_width(), grid()->cell_height()));
415 controller_->ConfigureCell(cell, tab_contents); 415 controller_->ConfigureCell(cell, tab_contents);
416 widget->Init(NULL, gfx::Rect(screen_loc, cell->GetPreferredSize()), true); 416 widget->Init(NULL, gfx::Rect(screen_loc, cell->GetPreferredSize()));
417 widget->GetRootView()->SetLayoutManager(new views::FillLayout()); 417 widget->GetRootView()->SetLayoutManager(new views::FillLayout());
418 widget->GetRootView()->AddChildView(cell); 418 widget->GetRootView()->AddChildView(cell);
419 419
420 std::vector<int> params(4); 420 std::vector<int> params(4);
421 params[0] = screen_loc.x() + x_offset_; 421 params[0] = screen_loc.x() + x_offset_;
422 params[1] = screen_loc.y() + y_offset_; 422 params[1] = screen_loc.y() + y_offset_;
423 params[2] = x_offset_; 423 params[2] = x_offset_;
424 params[3] = y_offset_; 424 params[3] = y_offset_;
425 TabOverviewTypes::instance()->SetWindowType( 425 TabOverviewTypes::instance()->SetWindowType(
426 widget->GetNativeView(), 426 widget->GetNativeView(),
(...skipping 21 matching lines...) Expand all
448 Source<TabContents>(tab)); 448 Source<TabContents>(tab));
449 449
450 // We need to be the delegate so we receive messages about stuff, 450 // We need to be the delegate so we receive messages about stuff,
451 // otherwise our dragged contents may be replaced and subsequently 451 // otherwise our dragged contents may be replaced and subsequently
452 // collected/destroyed while the drag is in process, leading to 452 // collected/destroyed while the drag is in process, leading to
453 // nasty crashes. 453 // nasty crashes.
454 original_delegate_ = tab->delegate(); 454 original_delegate_ = tab->delegate();
455 tab->set_delegate(this); 455 tab->set_delegate(this);
456 } 456 }
457 } 457 }
OLDNEW
« no previous file with comments | « chrome/browser/views/tabs/tab_overview_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698