OLD | NEW |
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 "chrome/browser/task_manager/task_manager_resource_providers.h" | 5 #include "chrome/browser/task_manager/task_manager_resource_providers.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_version_info.h" | 10 #include "base/file_version_info.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "chrome/browser/ui/browser_list.h" | 34 #include "chrome/browser/ui/browser_list.h" |
35 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 35 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
36 #include "chrome/common/chrome_notification_types.h" | 36 #include "chrome/common/chrome_notification_types.h" |
37 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
38 #include "chrome/common/chrome_view_types.h" | 38 #include "chrome/common/chrome_view_types.h" |
39 #include "chrome/common/extensions/extension.h" | 39 #include "chrome/common/extensions/extension.h" |
40 #include "chrome/common/render_messages.h" | 40 #include "chrome/common/render_messages.h" |
41 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
42 #include "content/browser/browser_child_process_host.h" | 42 #include "content/browser/browser_child_process_host.h" |
43 #include "content/browser/renderer_host/render_message_filter.h" | 43 #include "content/browser/renderer_host/render_message_filter.h" |
44 #include "content/browser/renderer_host/render_process_host.h" | |
45 #include "content/browser/renderer_host/render_view_host.h" | 44 #include "content/browser/renderer_host/render_view_host.h" |
46 #include "content/browser/tab_contents/tab_contents.h" | 45 #include "content/browser/tab_contents/tab_contents.h" |
47 #include "content/public/browser/browser_thread.h" | 46 #include "content/public/browser/browser_thread.h" |
48 #include "content/public/browser/notification_service.h" | 47 #include "content/public/browser/notification_service.h" |
| 48 #include "content/public/browser/render_process_host.h" |
49 #include "grit/generated_resources.h" | 49 #include "grit/generated_resources.h" |
50 #include "grit/theme_resources.h" | 50 #include "grit/theme_resources.h" |
51 #include "grit/theme_resources_standard.h" | 51 #include "grit/theme_resources_standard.h" |
52 #include "third_party/sqlite/sqlite3.h" | 52 #include "third_party/sqlite/sqlite3.h" |
53 #include "ui/base/l10n/l10n_util.h" | 53 #include "ui/base/l10n/l10n_util.h" |
54 #include "ui/base/resource/resource_bundle.h" | 54 #include "ui/base/resource/resource_bundle.h" |
55 #include "v8/include/v8.h" | 55 #include "v8/include/v8.h" |
56 | 56 |
57 #if defined(OS_MACOSX) | 57 #if defined(OS_MACOSX) |
58 #include "skia/ext/skia_utils_mac.h" | 58 #include "skia/ext/skia_utils_mac.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 base::i18n::AdjustStringForLocaleDirection(&tab_title); | 264 base::i18n::AdjustStringForLocaleDirection(&tab_title); |
265 } | 265 } |
266 | 266 |
267 // Only classify as an app if the URL is an app and the tab is hosting an | 267 // Only classify as an app if the URL is an app and the tab is hosting an |
268 // extension process. (It's possible to be showing the URL from before it | 268 // extension process. (It's possible to be showing the URL from before it |
269 // was installed as an app.) | 269 // was installed as an app.) |
270 ExtensionService* extension_service = | 270 ExtensionService* extension_service = |
271 tab_contents_->profile()->GetExtensionService(); | 271 tab_contents_->profile()->GetExtensionService(); |
272 extensions::ProcessMap* process_map = extension_service->process_map(); | 272 extensions::ProcessMap* process_map = extension_service->process_map(); |
273 bool is_app = extension_service->IsInstalledApp(url) && | 273 bool is_app = extension_service->IsInstalledApp(url) && |
274 process_map->Contains(contents->GetRenderProcessHost()->id()); | 274 process_map->Contains(contents->GetRenderProcessHost()->GetID()); |
275 | 275 |
276 int message_id = GetMessagePrefixID( | 276 int message_id = GetMessagePrefixID( |
277 is_app, | 277 is_app, |
278 HostsExtension(), | 278 HostsExtension(), |
279 tab_contents_->profile()->IsOffTheRecord(), | 279 tab_contents_->profile()->IsOffTheRecord(), |
280 IsPrerendering()); | 280 IsPrerendering()); |
281 return l10n_util::GetStringFUTF16(message_id, tab_title); | 281 return l10n_util::GetStringFUTF16(message_id, tab_title); |
282 } | 282 } |
283 | 283 |
284 string16 TaskManagerTabContentsResource::GetProfileName() const { | 284 string16 TaskManagerTabContentsResource::GetProfileName() const { |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 int origin_pid, | 559 int origin_pid, |
560 int render_process_host_id, | 560 int render_process_host_id, |
561 int routing_id) { | 561 int routing_id) { |
562 // If an origin PID was specified, the request is from a plugin, not the | 562 // If an origin PID was specified, the request is from a plugin, not the |
563 // render view host process | 563 // render view host process |
564 if (origin_pid) | 564 if (origin_pid) |
565 return NULL; | 565 return NULL; |
566 | 566 |
567 for (Resources::iterator i = resources_.begin(); i != resources_.end(); i++) { | 567 for (Resources::iterator i = resources_.begin(); i != resources_.end(); i++) { |
568 TabContents* tab = i->first->tab_contents(); | 568 TabContents* tab = i->first->tab_contents(); |
569 if (tab->render_view_host()->process()->id() == render_process_host_id && | 569 if (tab->render_view_host()->process()->GetID() == render_process_host_id |
570 tab->render_view_host()->routing_id() == routing_id) { | 570 && tab->render_view_host()->routing_id() == routing_id) { |
571 return i->second; | 571 return i->second; |
572 } | 572 } |
573 } | 573 } |
574 | 574 |
575 // Can happen if the page went away while a network request was being | 575 // Can happen if the page went away while a network request was being |
576 // performed. | 576 // performed. |
577 return NULL; | 577 return NULL; |
578 } | 578 } |
579 | 579 |
580 void TaskManagerBackgroundContentsResourceProvider::StartUpdating() { | 580 void TaskManagerBackgroundContentsResourceProvider::StartUpdating() { |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 | 1389 |
1390 return &resource_; | 1390 return &resource_; |
1391 } | 1391 } |
1392 | 1392 |
1393 void TaskManagerBrowserProcessResourceProvider::StartUpdating() { | 1393 void TaskManagerBrowserProcessResourceProvider::StartUpdating() { |
1394 task_manager_->AddResource(&resource_); | 1394 task_manager_->AddResource(&resource_); |
1395 } | 1395 } |
1396 | 1396 |
1397 void TaskManagerBrowserProcessResourceProvider::StopUpdating() { | 1397 void TaskManagerBrowserProcessResourceProvider::StopUpdating() { |
1398 } | 1398 } |
OLD | NEW |