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

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: Rebase 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 | « content/browser/renderer_host/render_message_filter.cc ('k') | no next file » | 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 "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 2296 matching lines...) Expand 10 before | Expand all | Expand 10 after
2345 } 2346 }
2346 2347
2347 void TabContents::WorkerCrashed() { 2348 void TabContents::WorkerCrashed() {
2348 if (delegate()) 2349 if (delegate())
2349 delegate()->WorkerCrashed(); 2350 delegate()->WorkerCrashed();
2350 } 2351 }
2351 2352
2352 void TabContents::RequestDesktopNotificationPermission( 2353 void TabContents::RequestDesktopNotificationPermission(
2353 const GURL& source_origin, int callback_context) { 2354 const GURL& source_origin, int callback_context) {
2354 DesktopNotificationService* service = 2355 DesktopNotificationService* service =
2355 profile()->GetDesktopNotificationService(); 2356 DesktopNotificationServiceFactory::GetForProfile(profile());
2356 service->RequestPermission( 2357 service->RequestPermission(
2357 source_origin, GetRenderProcessHost()->id(), 2358 source_origin, GetRenderProcessHost()->id(),
2358 render_view_host()->routing_id(), callback_context, this); 2359 render_view_host()->routing_id(), callback_context, this);
2359 } 2360 }
2360 2361
2361 void TabContents::OnUpdateFaviconURL( 2362 void TabContents::OnUpdateFaviconURL(
2362 int32 page_id, 2363 int32 page_id,
2363 const std::vector<FaviconURL>& candidates) { 2364 const std::vector<FaviconURL>& candidates) {
2364 favicon_helper().OnUpdateFaviconURL(page_id, candidates); 2365 favicon_helper().OnUpdateFaviconURL(page_id, candidates);
2365 if (touch_icon_helper_.get()) 2366 if (touch_icon_helper_.get())
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
2537 2538
2538 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2539 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2539 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 2540 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
2540 rwh_view->SetSize(view()->GetContainerSize()); 2541 rwh_view->SetSize(view()->GetContainerSize());
2541 } 2542 }
2542 2543
2543 void TabContents::OnOnlineStateChanged(bool online) { 2544 void TabContents::OnOnlineStateChanged(bool online) {
2544 render_view_host()->Send(new ViewMsg_NetworkStateChanged( 2545 render_view_host()->Send(new ViewMsg_NetworkStateChanged(
2545 render_view_host()->routing_id(), online)); 2546 render_view_host()->routing_id(), online));
2546 } 2547 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_message_filter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698