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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 return balloon_->notification().notification_id() == | 323 return balloon_->notification().notification_id() == |
324 notification.notification_id(); | 324 notification.notification_id(); |
325 } | 325 } |
326 | 326 |
327 void BalloonViewImpl::Activated() { | 327 void BalloonViewImpl::Activated() { |
328 if (!control_view_host_.get()) | 328 if (!control_view_host_.get()) |
329 return; | 329 return; |
330 | 330 |
331 // Get the size of Control View. | 331 // Get the size of Control View. |
332 gfx::Size size = | 332 gfx::Size size = |
333 control_view_host_->GetRootView()->GetChildViewAt(0)->GetPreferredSize(); | 333 control_view_host_->GetRootView()->child_at(0)->GetPreferredSize(); |
334 control_view_host_->Show(); | 334 control_view_host_->Show(); |
335 control_view_host_->SetBounds( | 335 control_view_host_->SetBounds( |
336 gfx::Rect(width() - size.width() - kControlViewRightMargin, | 336 gfx::Rect(width() - size.width() - kControlViewRightMargin, |
337 kControlViewTopMargin, | 337 kControlViewTopMargin, |
338 size.width(), size.height())); | 338 size.width(), size.height())); |
339 } | 339 } |
340 | 340 |
341 void BalloonViewImpl::Deactivated() { | 341 void BalloonViewImpl::Deactivated() { |
342 if (control_view_host_.get()) { | 342 if (control_view_host_.get()) { |
343 control_view_host_->Hide(); | 343 control_view_host_->Hide(); |
(...skipping 15 matching lines...) Expand all Loading... |
359 service->DenyPermission(balloon_->notification().origin_url()); | 359 service->DenyPermission(balloon_->notification().origin_url()); |
360 } | 360 } |
361 | 361 |
362 gfx::NativeView BalloonViewImpl::GetParentNativeView() { | 362 gfx::NativeView BalloonViewImpl::GetParentNativeView() { |
363 RenderWidgetHostView* view = html_contents_->render_view_host()->view(); | 363 RenderWidgetHostView* view = html_contents_->render_view_host()->view(); |
364 DCHECK(view); | 364 DCHECK(view); |
365 return view->GetNativeView(); | 365 return view->GetNativeView(); |
366 } | 366 } |
367 | 367 |
368 } // namespace chromeos | 368 } // namespace chromeos |
OLD | NEW |