OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/webui/memory_internals/memory_internals_proxy.h" | 5 #include "chrome/browser/ui/webui/memory_internals/memory_internals_proxy.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "base/sys_info.h" | 13 #include "base/sys_info.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/chrome_notification_types.h" | 16 #include "chrome/browser/chrome_notification_types.h" |
17 #include "chrome/browser/memory_details.h" | 17 #include "chrome/browser/memory_details.h" |
18 #include "chrome/browser/prerender/prerender_manager.h" | 18 #include "chrome/browser/prerender/prerender_manager.h" |
19 #include "chrome/browser/prerender/prerender_manager_factory.h" | 19 #include "chrome/browser/prerender/prerender_manager_factory.h" |
20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
22 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" | 22 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
23 #include "chrome/browser/search/instant_service.h" | |
24 #include "chrome/browser/search/instant_service_factory.h" | |
25 #include "chrome/browser/ui/android/tab_model/tab_model.h" | 23 #include "chrome/browser/ui/android/tab_model/tab_model.h" |
26 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" | 24 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" |
27 #include "chrome/browser/ui/browser.h" | 25 #include "chrome/browser/ui/browser.h" |
28 #include "chrome/browser/ui/browser_instant_controller.h" | |
29 #include "chrome/browser/ui/browser_iterator.h" | 26 #include "chrome/browser/ui/browser_iterator.h" |
30 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" | 27 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
31 #include "chrome/browser/ui/webui/memory_internals/memory_internals_handler.h" | 28 #include "chrome/browser/ui/webui/memory_internals/memory_internals_handler.h" |
32 #include "chrome/common/render_messages.h" | 29 #include "chrome/common/render_messages.h" |
33 #include "content/public/browser/navigation_controller.h" | 30 #include "content/public/browser/navigation_controller.h" |
34 #include "content/public/browser/navigation_entry.h" | 31 #include "content/public/browser/navigation_entry.h" |
35 #include "content/public/browser/notification_observer.h" | 32 #include "content/public/browser/notification_observer.h" |
36 #include "content/public/browser/notification_registrar.h" | 33 #include "content/public/browser/notification_registrar.h" |
37 #include "content/public/browser/notification_service.h" | 34 #include "content/public/browser/notification_service.h" |
38 #include "content/public/browser/render_process_host.h" | 35 #include "content/public/browser/render_process_host.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 g_browser_process->profile_manager()->GetLoadedProfiles()); | 99 g_browser_process->profile_manager()->GetLoadedProfiles()); |
103 for (size_t i = 0; i < profiles.size(); ++i) { | 100 for (size_t i = 0; i < profiles.size(); ++i) { |
104 prerender::PrerenderManager* prerender_manager = | 101 prerender::PrerenderManager* prerender_manager = |
105 prerender::PrerenderManagerFactory::GetForProfile(profiles[i]); | 102 prerender::PrerenderManagerFactory::GetForProfile(profiles[i]); |
106 if (!prerender_manager) | 103 if (!prerender_manager) |
107 continue; | 104 continue; |
108 const std::vector<content::WebContents*> contentses = | 105 const std::vector<content::WebContents*> contentses = |
109 prerender_manager->GetAllPrerenderingContents(); | 106 prerender_manager->GetAllPrerenderingContents(); |
110 web_contents->insert(contentses.begin(), contentses.end()); | 107 web_contents->insert(contentses.begin(), contentses.end()); |
111 } | 108 } |
112 // Add all the Instant Extended prerendered NTPs. | |
113 for (size_t i = 0; i < profiles.size(); ++i) { | |
114 const InstantService* instant_service = | |
115 InstantServiceFactory::GetForProfile(profiles[i]); | |
116 if (instant_service && instant_service->GetNTPContents()) | |
117 web_contents->insert(instant_service->GetNTPContents()); | |
118 } | |
119 #if defined(ENABLE_FULL_PRINTING) | 109 #if defined(ENABLE_FULL_PRINTING) |
120 // Add all the pages being background printed. | 110 // Add all the pages being background printed. |
121 printing::BackgroundPrintingManager* printing_manager = | 111 printing::BackgroundPrintingManager* printing_manager = |
122 g_browser_process->background_printing_manager(); | 112 g_browser_process->background_printing_manager(); |
123 std::set<content::WebContents*> printing_contents = | 113 std::set<content::WebContents*> printing_contents = |
124 printing_manager->CurrentContentSet(); | 114 printing_manager->CurrentContentSet(); |
125 web_contents->insert(printing_contents.begin(), printing_contents.end()); | 115 web_contents->insert(printing_contents.begin(), printing_contents.end()); |
126 #endif | 116 #endif |
127 } | 117 } |
128 | 118 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 const std::string& function, const base::Value& args) { | 339 const std::string& function, const base::Value& args) { |
350 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 340 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
351 | 341 |
352 std::vector<const base::Value*> args_vector(1, &args); | 342 std::vector<const base::Value*> args_vector(1, &args); |
353 base::string16 update = | 343 base::string16 update = |
354 content::WebUI::GetJavascriptCall(function, args_vector); | 344 content::WebUI::GetJavascriptCall(function, args_vector); |
355 // Don't forward updates to a destructed UI. | 345 // Don't forward updates to a destructed UI. |
356 if (handler_) | 346 if (handler_) |
357 handler_->OnUpdate(update); | 347 handler_->OnUpdate(update); |
358 } | 348 } |
OLD | NEW |