| Index: chrome/browser/task_manager/task_manager_resource_providers.cc
|
| diff --git a/chrome/browser/task_manager/task_manager_resource_providers.cc b/chrome/browser/task_manager/task_manager_resource_providers.cc
|
| index 99ef27871afde2f8656df20081d2da2a2b68814d..92d438597e803ecb80b34c1ce261a30818f519c9 100644
|
| --- a/chrome/browser/task_manager/task_manager_resource_providers.cc
|
| +++ b/chrome/browser/task_manager/task_manager_resource_providers.cc
|
| @@ -28,6 +28,10 @@
|
| #include "chrome/browser/extensions/extension_service.h"
|
| #include "chrome/browser/extensions/extension_system.h"
|
| #include "chrome/browser/favicon/favicon_tab_helper.h"
|
| +#include "chrome/browser/instant/instant_controller.h"
|
| +#include "chrome/browser/instant/instant_preloader.h"
|
| +#include "chrome/browser/instant/instant_service.h"
|
| +#include "chrome/browser/instant/instant_service_factory.h"
|
| #include "chrome/browser/prerender/prerender_manager.h"
|
| #include "chrome/browser/prerender/prerender_manager_factory.h"
|
| #include "chrome/browser/printing/background_printing_manager.h"
|
| @@ -159,12 +163,19 @@ bool IsContentsPrerendering(WebContents* web_contents) {
|
| }
|
|
|
| bool IsContentsInstant(WebContents* web_contents) {
|
| + Profile* profile =
|
| + Profile::FromBrowserContext(web_contents->GetBrowserContext());
|
| + InstantService* instant_service =
|
| + InstantServiceFactory::GetForProfile(profile);
|
| + if (instant_service &&
|
| + instant_service->preloader()->contents() == web_contents)
|
| + return true;
|
| +
|
| for (chrome::BrowserIterator it; !it.done(); it.Next()) {
|
| if (it->instant_controller() &&
|
| - it->instant_controller()->instant()->
|
| - GetOverlayContents() == web_contents) {
|
| + it->instant_controller()->instant()->GetOverlayContents() ==
|
| + web_contents)
|
| return true;
|
| - }
|
| }
|
|
|
| return false;
|
| @@ -438,15 +449,14 @@ void TaskManagerTabContentsResourceProvider::StartUpdating() {
|
| // Add all the Instant pages.
|
| for (chrome::BrowserIterator it; !it.done(); it.Next()) {
|
| if (it->instant_controller() &&
|
| - it->instant_controller()->instant()->GetOverlayContents()) {
|
| + it->instant_controller()->instant()->GetOverlayContents())
|
| Add(it->instant_controller()->instant()->GetOverlayContents());
|
| - }
|
| }
|
|
|
| - // Add all the prerender pages.
|
| std::vector<Profile*> profiles(
|
| g_browser_process->profile_manager()->GetLoadedProfiles());
|
| for (size_t i = 0; i < profiles.size(); ++i) {
|
| + // Add all the prerender pages.
|
| prerender::PrerenderManager* prerender_manager =
|
| prerender::PrerenderManagerFactory::GetForProfile(profiles[i]);
|
| if (prerender_manager) {
|
| @@ -455,6 +465,12 @@ void TaskManagerTabContentsResourceProvider::StartUpdating() {
|
| for (size_t j = 0; j < contentses.size(); ++j)
|
| Add(contentses[j]);
|
| }
|
| +
|
| + // Add the Instant per-profile preloaded page.
|
| + InstantService* instant_service =
|
| + InstantServiceFactory::GetForProfile(profiles[i]);
|
| + if (instant_service && instant_service->preloader()->contents())
|
| + Add(instant_service->preloader()->contents());
|
| }
|
|
|
| // Add all the pages being background printed.
|
|
|