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

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

Issue 6813116: Revert 81277 - Profile shouldn't own DesktopNotificationService.DesktopNotificationService is now... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/content_settings/content_settings_notification_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
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"
16 #include "chrome/browser/notifications/notification.h" 15 #include "chrome/browser/notifications/notification.h"
17 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/ui/views/notifications/balloon_view_host.h" 17 #include "chrome/browser/ui/views/notifications/balloon_view_host.h"
19 #include "content/browser/renderer_host/render_view_host.h" 18 #include "content/browser/renderer_host/render_view_host.h"
20 #include "content/browser/renderer_host/render_widget_host_view.h" 19 #include "content/browser/renderer_host/render_widget_host_view.h"
21 #include "content/common/notification_details.h" 20 #include "content/common/notification_details.h"
22 #include "content/common/notification_source.h" 21 #include "content/common/notification_source.h"
23 #include "content/common/notification_type.h" 22 #include "content/common/notification_type.h"
24 #include "grit/generated_resources.h" 23 #include "grit/generated_resources.h"
25 #include "grit/theme_resources.h" 24 #include "grit/theme_resources.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 // BalloonViewImpl private. 331 // BalloonViewImpl private.
333 332
334 void BalloonViewImpl::DelayedClose(bool by_user) { 333 void BalloonViewImpl::DelayedClose(bool by_user) {
335 html_contents_->Shutdown(); 334 html_contents_->Shutdown();
336 html_contents_ = NULL; 335 html_contents_ = NULL;
337 balloon_->OnClose(by_user); 336 balloon_->OnClose(by_user);
338 } 337 }
339 338
340 void BalloonViewImpl::DenyPermission() { 339 void BalloonViewImpl::DenyPermission() {
341 DesktopNotificationService* service = 340 DesktopNotificationService* service =
342 DesktopNotificationServiceFactory::GetForProfile(balloon_->profile()); 341 balloon_->profile()->GetDesktopNotificationService();
343 service->DenyPermission(balloon_->notification().origin_url()); 342 service->DenyPermission(balloon_->notification().origin_url());
344 } 343 }
345 344
346 gfx::NativeView BalloonViewImpl::GetParentNativeView() { 345 gfx::NativeView BalloonViewImpl::GetParentNativeView() {
347 RenderWidgetHostView* view = html_contents_->render_view_host()->view(); 346 RenderWidgetHostView* view = html_contents_->render_view_host()->view();
348 DCHECK(view); 347 DCHECK(view);
349 return view->GetNativeView(); 348 return view->GetNativeView();
350 } 349 }
351 350
352 } // namespace chromeos 351 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/content_settings/content_settings_notification_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698