summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/notifications/balloon_view.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-26 17:43:05 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-26 17:43:05 +0000
commitaf1fde05ba3696986ba28445ea0c74f96d456ebb (patch)
tree8986d27bfec650d279fa085767279a59442c6eaf /chrome/browser/chromeos/notifications/balloon_view.cc
parenta6ea9c6010cfa383356c3e84c2976132ce22c9d1 (diff)
downloadchromium_src-af1fde05ba3696986ba28445ea0c74f96d456ebb.zip
chromium_src-af1fde05ba3696986ba28445ea0c74f96d456ebb.tar.gz
chromium_src-af1fde05ba3696986ba28445ea0c74f96d456ebb.tar.bz2
Rework the way Widget::Init works:
- Remove SetCreateParams from the public Widget API. - Add parent/bounds fields to CreateParams - Make Widget::Init be the canonical init method (vs. WidgetWin/Gtk Init) and have it take a CreateParams. - NativeWidget now has a InitNativeWidget method, which subclasses can override. Everyone must call Widget::Init via Widget* (not WidgetWin* as this will be ambiguous to WindowImpl::Init). BUG=72040 TEST=none Review URL: http://codereview.chromium.org/6881107 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83037 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/notifications/balloon_view.cc')
-rw-r--r--chrome/browser/chromeos/notifications/balloon_view.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/chromeos/notifications/balloon_view.cc b/chrome/browser/chromeos/notifications/balloon_view.cc
index 6246e51..89317af 100644
--- a/chrome/browser/chromeos/notifications/balloon_view.cc
+++ b/chrome/browser/chromeos/notifications/balloon_view.cc
@@ -267,19 +267,19 @@ void BalloonViewImpl::Layout() {
void BalloonViewImpl::ViewHierarchyChanged(
bool is_add, View* parent, View* child) {
if (is_add && GetWidget() && !control_view_host_.get() && controls_) {
+ control_view_host_.reset(views::Widget::CreateWidget());
+ static_cast<views::WidgetGtk*>(control_view_host_.get())->
+ EnableDoubleBuffer(true);
views::Widget::CreateParams params(
views::Widget::CreateParams::TYPE_CONTROL);
params.delete_on_destroy = false;
- control_view_host_.reset(views::Widget::CreateWidget(params));
- static_cast<views::WidgetGtk*>(control_view_host_.get())->
- EnableDoubleBuffer(true);
- control_view_host_->Init(GetParentNativeView(), gfx::Rect());
+ params.parent = GetParentNativeView();
+ control_view_host_->Init(params);
NotificationControlView* control = new NotificationControlView(this);
control_view_host_->SetContentsView(control);
}
- if (!is_add && this == child && control_view_host_.get() && controls_) {
+ if (!is_add && this == child && control_view_host_.get() && controls_)
control_view_host_.release()->CloseNow();
- }
}
////////////////////////////////////////////////////////////////////////////////