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

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

Issue 9473001: Extract minimal RenderViewHost interface for embedders, leaving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR. Created 8 years, 9 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // views::View interface overrides. 268 // views::View interface overrides.
269 269
270 void BalloonViewImpl::Layout() { 270 void BalloonViewImpl::Layout() {
271 gfx::Size size = balloon_->content_size(); 271 gfx::Size size = balloon_->content_size();
272 272
273 SetBounds(x(), y(), size.width(), size.height()); 273 SetBounds(x(), y(), size.width(), size.height());
274 274
275 html_contents_->view()->SetBounds(0, 0, size.width(), size.height()); 275 html_contents_->view()->SetBounds(0, 0, size.width(), size.height());
276 if (html_contents_->web_contents()) { 276 if (html_contents_->web_contents()) {
277 RenderWidgetHostView* view = 277 RenderWidgetHostView* view =
278 html_contents_->web_contents()->GetRenderViewHost()->view(); 278 html_contents_->web_contents()->GetRenderViewHost()->GetView();
279 if (view) 279 if (view)
280 view->SetSize(size); 280 view->SetSize(size);
281 } 281 }
282 } 282 }
283 283
284 void BalloonViewImpl::ViewHierarchyChanged( 284 void BalloonViewImpl::ViewHierarchyChanged(
285 bool is_add, View* parent, View* child) { 285 bool is_add, View* parent, View* child) {
286 if (is_add && GetWidget() && !control_view_host_.get() && controls_) { 286 if (is_add && GetWidget() && !control_view_host_.get() && controls_) {
287 control_view_host_.reset(new views::Widget); 287 control_view_host_.reset(new views::Widget);
288 views::Widget::InitParams params( 288 views::Widget::InitParams params(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 359 }
360 360
361 void BalloonViewImpl::DenyPermission() { 361 void BalloonViewImpl::DenyPermission() {
362 DesktopNotificationService* service = 362 DesktopNotificationService* service =
363 DesktopNotificationServiceFactory::GetForProfile(balloon_->profile()); 363 DesktopNotificationServiceFactory::GetForProfile(balloon_->profile());
364 service->DenyPermission(balloon_->notification().origin_url()); 364 service->DenyPermission(balloon_->notification().origin_url());
365 } 365 }
366 366
367 gfx::NativeView BalloonViewImpl::GetParentNativeView() { 367 gfx::NativeView BalloonViewImpl::GetParentNativeView() {
368 RenderWidgetHostView* view = 368 RenderWidgetHostView* view =
369 html_contents_->web_contents()->GetRenderViewHost()->view(); 369 html_contents_->web_contents()->GetRenderViewHost()->GetView();
370 DCHECK(view); 370 DCHECK(view);
371 return view->GetNativeView(); 371 return view->GetNativeView();
372 } 372 }
373 373
374 } // namespace chromeos 374 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698