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

Side by Side Diff: chrome/browser/chromeos/notifications/balloon_view.cc

Issue 7015051: Re-land: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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/chromeos/notifications/balloon_view.h" 5 #include "chrome/browser/chromeos/notifications/balloon_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 if (html_contents_->render_view_host()) { 260 if (html_contents_->render_view_host()) {
261 RenderWidgetHostView* view = html_contents_->render_view_host()->view(); 261 RenderWidgetHostView* view = html_contents_->render_view_host()->view();
262 if (view) 262 if (view)
263 view->SetSize(size); 263 view->SetSize(size);
264 } 264 }
265 } 265 }
266 266
267 void BalloonViewImpl::ViewHierarchyChanged( 267 void BalloonViewImpl::ViewHierarchyChanged(
268 bool is_add, View* parent, View* child) { 268 bool is_add, View* parent, View* child) {
269 if (is_add && GetWidget() && !control_view_host_.get() && controls_) { 269 if (is_add && GetWidget() && !control_view_host_.get() && controls_) {
270 control_view_host_.reset(views::Widget::CreateWidget()); 270 control_view_host_.reset(new views::Widget);
271 views::Widget::InitParams params( 271 views::Widget::InitParams params(
272 views::Widget::InitParams::TYPE_CONTROL); 272 views::Widget::InitParams::TYPE_CONTROL);
273 params.double_buffer = true; 273 params.double_buffer = true;
274 params.delete_on_destroy = false; 274 params.delete_on_destroy = false;
275 params.parent = GetParentNativeView(); 275 params.parent = GetParentNativeView();
276 control_view_host_->Init(params); 276 control_view_host_->Init(params);
277 NotificationControlView* control = new NotificationControlView(this); 277 NotificationControlView* control = new NotificationControlView(this);
278 control_view_host_->SetContentsView(control); 278 control_view_host_->SetContentsView(control);
279 } 279 }
280 if (!is_add && this == child && control_view_host_.get() && controls_) 280 if (!is_add && this == child && control_view_host_.get() && controls_)
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 service->DenyPermission(balloon_->notification().origin_url()); 342 service->DenyPermission(balloon_->notification().origin_url());
343 } 343 }
344 344
345 gfx::NativeView BalloonViewImpl::GetParentNativeView() { 345 gfx::NativeView BalloonViewImpl::GetParentNativeView() {
346 RenderWidgetHostView* view = html_contents_->render_view_host()->view(); 346 RenderWidgetHostView* view = html_contents_->render_view_host()->view();
347 DCHECK(view); 347 DCHECK(view);
348 return view->GetNativeView(); 348 return view->GetNativeView();
349 } 349 }
350 350
351 } // namespace chromeos 351 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/native_dialog_window.cc ('k') | chrome/browser/chromeos/notifications/notification_panel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698