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

Unified Diff: chrome/browser/chromeos/notifications/notification_panel.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/notifications/notification_panel.cc
===================================================================
--- chrome/browser/chromeos/notifications/notification_panel.cc (revision 83020)
+++ chrome/browser/chromeos/notifications/notification_panel.cc (working copy)
@@ -73,8 +73,7 @@
class ViewportWidget : public views::WidgetGtk {
public:
explicit ViewportWidget(chromeos::NotificationPanel* panel)
- : WidgetGtk(views::WidgetGtk::TYPE_CHILD),
- panel_(panel) {
+ : panel_(panel) {
}
void UpdateControl() {
@@ -415,18 +414,18 @@
void NotificationPanel::Show() {
if (!panel_widget_) {
- // TODO(oshima): Using window because Popup widget behaves weird
- // when resizing. This needs to be investigated.
- views::WidgetGtk* widget_gtk =
- new views::WidgetGtk(views::WidgetGtk::TYPE_WINDOW);
+ panel_widget_ = views::Widget::CreateWidget();
// Enable double buffering because the panel has both pure views
// control and native controls (scroll bar).
- widget_gtk->EnableDoubleBuffer(true);
- panel_widget_ = widget_gtk;
+ static_cast<views::WidgetGtk*>(panel_widget_->native_widget())->
+ EnableDoubleBuffer(true);
gfx::Rect bounds = GetPreferredBounds();
bounds = bounds.Union(min_bounds_);
- panel_widget_->Init(NULL, bounds);
+ views::Widget::CreateParams params(
+ views::Widget::CreateParams::TYPE_WINDOW);
+ params.bounds = bounds;
+ panel_widget_->Init(params);
// Set minimum bounds so that it can grow freely.
gtk_widget_set_size_request(GTK_WIDGET(panel_widget_->GetNativeView()),
min_bounds_.width(), min_bounds_.height());
@@ -439,7 +438,8 @@
// Add the view port after scroll_view is attached to the panel widget.
ViewportWidget* widget = new ViewportWidget(this);
container_host_ = widget;
- container_host_->Init(NULL, gfx::Rect());
+ container_host_->Init(
+ views::Widget::CreateParams(views::Widget::CreateParams::TYPE_CONTROL));
container_host_->SetContentsView(balloon_container_.get());
// The window_contents_ is onwed by the WidgetGtk. Increase ref count
// so that window_contents does not get deleted when detached.
« no previous file with comments | « chrome/browser/chromeos/notifications/balloon_view.cc ('k') | chrome/browser/chromeos/panels/panel_scroller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698