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

Side by Side Diff: content/browser/tab_contents/tab_contents.cc

Issue 6803012: Profile shouldn't own DesktopNotificationService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix dependency manager unit test 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
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 "content/browser/tab_contents/tab_contents.h" 5 #include "content/browser/tab_contents/tab_contents.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 18 matching lines...) Expand all
29 #include "chrome/browser/external_protocol_handler.h" 29 #include "chrome/browser/external_protocol_handler.h"
30 #include "chrome/browser/favicon_service.h" 30 #include "chrome/browser/favicon_service.h"
31 #include "chrome/browser/google/google_util.h" 31 #include "chrome/browser/google/google_util.h"
32 #include "chrome/browser/history/history.h" 32 #include "chrome/browser/history/history.h"
33 #include "chrome/browser/history/history_types.h" 33 #include "chrome/browser/history/history_types.h"
34 #include "chrome/browser/load_from_memory_cache_details.h" 34 #include "chrome/browser/load_from_memory_cache_details.h"
35 #include "chrome/browser/load_notification_details.h" 35 #include "chrome/browser/load_notification_details.h"
36 #include "chrome/browser/metrics/metric_event_duration_details.h" 36 #include "chrome/browser/metrics/metric_event_duration_details.h"
37 #include "chrome/browser/metrics/user_metrics.h" 37 #include "chrome/browser/metrics/user_metrics.h"
38 #include "chrome/browser/notifications/desktop_notification_service.h" 38 #include "chrome/browser/notifications/desktop_notification_service.h"
39 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
39 #include "chrome/browser/omnibox_search_hint.h" 40 #include "chrome/browser/omnibox_search_hint.h"
40 #include "chrome/browser/pdf_unsupported_feature.h" 41 #include "chrome/browser/pdf_unsupported_feature.h"
41 #include "chrome/browser/platform_util.h" 42 #include "chrome/browser/platform_util.h"
42 #include "chrome/browser/plugin_observer.h" 43 #include "chrome/browser/plugin_observer.h"
43 #include "chrome/browser/prefs/pref_service.h" 44 #include "chrome/browser/prefs/pref_service.h"
44 #include "chrome/browser/profiles/profile.h" 45 #include "chrome/browser/profiles/profile.h"
45 #include "chrome/browser/renderer_host/web_cache_manager.h" 46 #include "chrome/browser/renderer_host/web_cache_manager.h"
46 #include "chrome/browser/renderer_preferences_util.h" 47 #include "chrome/browser/renderer_preferences_util.h"
47 #include "chrome/browser/safe_browsing/client_side_detection_host.h" 48 #include "chrome/browser/safe_browsing/client_side_detection_host.h"
48 #include "chrome/browser/sessions/session_types.h" 49 #include "chrome/browser/sessions/session_types.h"
(...skipping 2345 matching lines...) Expand 10 before | Expand all | Expand 10 after
2394 } 2395 }
2395 2396
2396 void TabContents::WorkerCrashed() { 2397 void TabContents::WorkerCrashed() {
2397 if (delegate()) 2398 if (delegate())
2398 delegate()->WorkerCrashed(); 2399 delegate()->WorkerCrashed();
2399 } 2400 }
2400 2401
2401 void TabContents::RequestDesktopNotificationPermission( 2402 void TabContents::RequestDesktopNotificationPermission(
2402 const GURL& source_origin, int callback_context) { 2403 const GURL& source_origin, int callback_context) {
2403 DesktopNotificationService* service = 2404 DesktopNotificationService* service =
2404 profile()->GetDesktopNotificationService(); 2405 DesktopNotificationServiceFactory::GetForProfile(profile());
2405 service->RequestPermission( 2406 service->RequestPermission(
2406 source_origin, GetRenderProcessHost()->id(), 2407 source_origin, GetRenderProcessHost()->id(),
2407 render_view_host()->routing_id(), callback_context, this); 2408 render_view_host()->routing_id(), callback_context, this);
2408 } 2409 }
2409 2410
2410 void TabContents::BeforeUnloadFiredFromRenderManager( 2411 void TabContents::BeforeUnloadFiredFromRenderManager(
2411 bool proceed, 2412 bool proceed,
2412 bool* proceed_to_fire_unload) { 2413 bool* proceed_to_fire_unload) {
2413 if (delegate()) 2414 if (delegate())
2414 delegate()->BeforeUnloadFired(this, proceed, proceed_to_fire_unload); 2415 delegate()->BeforeUnloadFired(this, proceed, proceed_to_fire_unload);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2578 2579
2579 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2580 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2580 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 2581 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
2581 rwh_view->SetSize(view()->GetContainerSize()); 2582 rwh_view->SetSize(view()->GetContainerSize());
2582 } 2583 }
2583 2584
2584 void TabContents::OnOnlineStateChanged(bool online) { 2585 void TabContents::OnOnlineStateChanged(bool online) {
2585 render_view_host()->Send(new ViewMsg_NetworkStateChanged( 2586 render_view_host()->Send(new ViewMsg_NetworkStateChanged(
2586 render_view_host()->routing_id(), online)); 2587 render_view_host()->routing_id(), online));
2587 } 2588 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698