| 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" |
| 11 #include "chrome/browser/chromeos/notifications/balloon_view_host.h" | 11 #include "chrome/browser/chromeos/notifications/balloon_view_host.h" |
| 12 #include "chrome/browser/chromeos/notifications/notification_panel.h" | 12 #include "chrome/browser/chromeos/notifications/notification_panel.h" |
| 13 #include "chrome/browser/notifications/balloon.h" | 13 #include "chrome/browser/notifications/balloon.h" |
| 14 #include "chrome/browser/notifications/desktop_notification_service.h" | 14 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 15 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 15 #include "chrome/browser/notifications/notification.h" | 16 #include "chrome/browser/notifications/notification.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/ui/views/notifications/balloon_view_host.h" | 18 #include "chrome/browser/ui/views/notifications/balloon_view_host.h" |
| 18 #include "content/browser/renderer_host/render_view_host.h" | 19 #include "content/browser/renderer_host/render_view_host.h" |
| 19 #include "content/browser/renderer_host/render_widget_host_view.h" | 20 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 20 #include "content/common/notification_details.h" | 21 #include "content/common/notification_details.h" |
| 21 #include "content/common/notification_source.h" | 22 #include "content/common/notification_source.h" |
| 22 #include "content/common/notification_type.h" | 23 #include "content/common/notification_type.h" |
| 23 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| 24 #include "grit/theme_resources.h" | 25 #include "grit/theme_resources.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 // BalloonViewImpl private. | 332 // BalloonViewImpl private. |
| 332 | 333 |
| 333 void BalloonViewImpl::DelayedClose(bool by_user) { | 334 void BalloonViewImpl::DelayedClose(bool by_user) { |
| 334 html_contents_->Shutdown(); | 335 html_contents_->Shutdown(); |
| 335 html_contents_ = NULL; | 336 html_contents_ = NULL; |
| 336 balloon_->OnClose(by_user); | 337 balloon_->OnClose(by_user); |
| 337 } | 338 } |
| 338 | 339 |
| 339 void BalloonViewImpl::DenyPermission() { | 340 void BalloonViewImpl::DenyPermission() { |
| 340 DesktopNotificationService* service = | 341 DesktopNotificationService* service = |
| 341 balloon_->profile()->GetDesktopNotificationService(); | 342 DesktopNotificationServiceFactory::GetForProfile(balloon_->profile()); |
| 342 service->DenyPermission(balloon_->notification().origin_url()); | 343 service->DenyPermission(balloon_->notification().origin_url()); |
| 343 } | 344 } |
| 344 | 345 |
| 345 gfx::NativeView BalloonViewImpl::GetParentNativeView() { | 346 gfx::NativeView BalloonViewImpl::GetParentNativeView() { |
| 346 RenderWidgetHostView* view = html_contents_->render_view_host()->view(); | 347 RenderWidgetHostView* view = html_contents_->render_view_host()->view(); |
| 347 DCHECK(view); | 348 DCHECK(view); |
| 348 return view->GetNativeView(); | 349 return view->GetNativeView(); |
| 349 } | 350 } |
| 350 | 351 |
| 351 } // namespace chromeos | 352 } // namespace chromeos |
| OLD | NEW |