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

Side by Side Diff: chrome/browser/task_manager/tab_contents_resource_provider.cc

Issue 133013002: Remove render process and WebContents notifications from background printing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 6 years, 11 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/task_manager/tab_contents_resource_provider.h" 5 #include "chrome/browser/task_manager/tab_contents_resource_provider.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/devtools/devtools_window.h" 9 #include "chrome/browser/devtools/devtools_window.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 const InstantService* instant_service = 242 const InstantService* instant_service =
243 InstantServiceFactory::GetForProfile(profiles[i]); 243 InstantServiceFactory::GetForProfile(profiles[i]);
244 if (instant_service && instant_service->GetNTPContents()) 244 if (instant_service && instant_service->GetNTPContents())
245 Add(instant_service->GetNTPContents()); 245 Add(instant_service->GetNTPContents());
246 } 246 }
247 247
248 #if defined(ENABLE_FULL_PRINTING) 248 #if defined(ENABLE_FULL_PRINTING)
249 // Add all the pages being background printed. 249 // Add all the pages being background printed.
250 printing::BackgroundPrintingManager* printing_manager = 250 printing::BackgroundPrintingManager* printing_manager =
251 g_browser_process->background_printing_manager(); 251 g_browser_process->background_printing_manager();
252 for (printing::BackgroundPrintingManager::WebContentsSet::iterator i = 252 std::set<content::WebContents*> printing_contents =
253 printing_manager->begin(); 253 printing_manager->CurrentContentSet();
254 i != printing_manager->end(); ++i) { 254 for (std::set<content::WebContents*>::iterator i =
255 printing_contents.begin();
256 i != printing_contents.end(); ++i) {
255 Add(*i); 257 Add(*i);
256 } 258 }
257 #endif 259 #endif
258 260
259 // Then we register for notifications to get new web contents. 261 // Then we register for notifications to get new web contents.
260 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, 262 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED,
261 content::NotificationService::AllBrowserContextsAndSources()); 263 content::NotificationService::AllBrowserContextsAndSources());
262 registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, 264 registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED,
263 content::NotificationService::AllBrowserContextsAndSources()); 265 content::NotificationService::AllBrowserContextsAndSources());
264 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, 266 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 case content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED: 361 case content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED:
360 Remove(web_contents); 362 Remove(web_contents);
361 break; 363 break;
362 default: 364 default:
363 NOTREACHED() << "Unexpected notification."; 365 NOTREACHED() << "Unexpected notification.";
364 return; 366 return;
365 } 367 }
366 } 368 }
367 369
368 } // namespace task_manager 370 } // namespace task_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698