| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_management/providers/web_contents/subframe_task.h" | 5 #include "chrome/browser/task_management/providers/web_contents/subframe_task.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
| 9 #include "content/public/browser/browser_context.h" | 9 #include "content/public/browser/browser_context.h" |
| 10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 IDS_TASK_MANAGER_SUBFRAME_INCOGNITO_PREFIX : | 23 IDS_TASK_MANAGER_SUBFRAME_INCOGNITO_PREFIX : |
| 24 IDS_TASK_MANAGER_SUBFRAME_PREFIX; | 24 IDS_TASK_MANAGER_SUBFRAME_PREFIX; |
| 25 | 25 |
| 26 return l10n_util::GetStringFUTF16(message_id, base::UTF8ToUTF16( | 26 return l10n_util::GetStringFUTF16(message_id, base::UTF8ToUTF16( |
| 27 site_instance->GetSiteURL().spec())); | 27 site_instance->GetSiteURL().spec())); |
| 28 } | 28 } |
| 29 | 29 |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 SubframeTask::SubframeTask(content::RenderFrameHost* render_frame_host, | 32 SubframeTask::SubframeTask(content::RenderFrameHost* render_frame_host, |
| 33 content::WebContents* web_contents) | 33 content::WebContents* web_contents, |
| 34 RendererTask* main_task) |
| 34 : RendererTask(AdjustTitle(render_frame_host->GetSiteInstance()), | 35 : RendererTask(AdjustTitle(render_frame_host->GetSiteInstance()), |
| 35 nullptr, | 36 nullptr, |
| 36 web_contents, | 37 web_contents, |
| 37 render_frame_host->GetProcess()) { | 38 render_frame_host->GetProcess()), |
| 39 main_task_(main_task) { |
| 38 // Note that we didn't get the RenderProcessHost from the WebContents, but | 40 // Note that we didn't get the RenderProcessHost from the WebContents, but |
| 39 // rather from the RenderFrameHost. Out-of-process iframes reside on | 41 // rather from the RenderFrameHost. Out-of-process iframes reside on |
| 40 // different processes than that of their main frame. | 42 // different processes than that of their main frame. |
| 41 } | 43 } |
| 42 | 44 |
| 43 SubframeTask::~SubframeTask() { | 45 SubframeTask::~SubframeTask() { |
| 44 } | 46 } |
| 45 | 47 |
| 46 void SubframeTask::UpdateTitle() { | 48 void SubframeTask::UpdateTitle() { |
| 47 // This will be called when the title changes on the WebContents's main frame, | 49 // This will be called when the title changes on the WebContents's main frame, |
| 48 // but this Task represents other frames, so we don't care. | 50 // but this Task represents other frames, so we don't care. |
| 49 } | 51 } |
| 50 | 52 |
| 51 void SubframeTask::UpdateFavicon() { | 53 void SubframeTask::UpdateFavicon() { |
| 52 // This will be called when the favicon changes on the WebContents's main | 54 // This will be called when the favicon changes on the WebContents's main |
| 53 // frame, but this Task represents other frames, so we don't care. | 55 // frame, but this Task represents other frames, so we don't care. |
| 54 } | 56 } |
| 55 | 57 |
| 58 void SubframeTask::Activate() { |
| 59 // Activate the root task. |
| 60 main_task_->Activate(); |
| 61 } |
| 62 |
| 56 } // namespace task_management | 63 } // namespace task_management |
| OLD | NEW |