OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |