| 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/task_manager/child_process_resource_provider.h" | 5 #include "chrome/browser/task_manager/child_process_resource_provider.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 using content::WebContents; | 25 using content::WebContents; |
| 26 | 26 |
| 27 namespace task_manager { | 27 namespace task_manager { |
| 28 | 28 |
| 29 class ChildProcessResource : public Resource { | 29 class ChildProcessResource : public Resource { |
| 30 public: | 30 public: |
| 31 ChildProcessResource(int process_type, | 31 ChildProcessResource(int process_type, |
| 32 const base::string16& name, | 32 const base::string16& name, |
| 33 base::ProcessHandle handle, | 33 base::ProcessHandle handle, |
| 34 int unique_process_id); | 34 int unique_process_id); |
| 35 virtual ~ChildProcessResource(); | 35 ~ChildProcessResource() override; |
| 36 | 36 |
| 37 // Resource methods: | 37 // Resource methods: |
| 38 virtual base::string16 GetTitle() const override; | 38 base::string16 GetTitle() const override; |
| 39 virtual base::string16 GetProfileName() const override; | 39 base::string16 GetProfileName() const override; |
| 40 virtual gfx::ImageSkia GetIcon() const override; | 40 gfx::ImageSkia GetIcon() const override; |
| 41 virtual base::ProcessHandle GetProcess() const override; | 41 base::ProcessHandle GetProcess() const override; |
| 42 virtual int GetUniqueChildProcessId() const override; | 42 int GetUniqueChildProcessId() const override; |
| 43 virtual Type GetType() const override; | 43 Type GetType() const override; |
| 44 virtual bool SupportNetworkUsage() const override; | 44 bool SupportNetworkUsage() const override; |
| 45 virtual void SetSupportNetworkUsage() override; | 45 void SetSupportNetworkUsage() override; |
| 46 | 46 |
| 47 // Returns the pid of the child process. | 47 // Returns the pid of the child process. |
| 48 int process_id() const { return pid_; } | 48 int process_id() const { return pid_; } |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 // Returns a localized title for the child process. For example, a plugin | 51 // Returns a localized title for the child process. For example, a plugin |
| 52 // process would be "Plug-in: Flash" when name is "Flash". | 52 // process would be "Plug-in: Flash" when name is "Flash". |
| 53 base::string16 GetLocalizedTitle() const; | 53 base::string16 GetLocalizedTitle() const; |
| 54 | 54 |
| 55 int process_type_; | 55 int process_type_; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 // This is called on the UI thread. | 327 // This is called on the UI thread. |
| 328 void ChildProcessResourceProvider::ChildProcessDataRetreived( | 328 void ChildProcessResourceProvider::ChildProcessDataRetreived( |
| 329 const std::vector<content::ChildProcessData>& child_processes) { | 329 const std::vector<content::ChildProcessData>& child_processes) { |
| 330 for (size_t i = 0; i < child_processes.size(); ++i) | 330 for (size_t i = 0; i < child_processes.size(); ++i) |
| 331 AddToTaskManager(child_processes[i]); | 331 AddToTaskManager(child_processes[i]); |
| 332 | 332 |
| 333 task_manager_->model()->NotifyDataReady(); | 333 task_manager_->model()->NotifyDataReady(); |
| 334 } | 334 } |
| 335 | 335 |
| 336 } // namespace task_manager | 336 } // namespace task_manager |
| OLD | NEW |