OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 10 #include "base/bind.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "chrome/browser/favicon/favicon_tab_helper.h" | 29 #include "chrome/browser/favicon/favicon_tab_helper.h" |
30 #include "chrome/browser/instant/instant_controller.h" | 30 #include "chrome/browser/instant/instant_controller.h" |
31 #include "chrome/browser/prerender/prerender_manager.h" | 31 #include "chrome/browser/prerender/prerender_manager.h" |
32 #include "chrome/browser/prerender/prerender_manager_factory.h" | 32 #include "chrome/browser/prerender/prerender_manager_factory.h" |
33 #include "chrome/browser/profiles/profile.h" | 33 #include "chrome/browser/profiles/profile.h" |
34 #include "chrome/browser/profiles/profile_info_cache.h" | 34 #include "chrome/browser/profiles/profile_info_cache.h" |
35 #include "chrome/browser/profiles/profile_manager.h" | 35 #include "chrome/browser/profiles/profile_manager.h" |
36 #include "chrome/browser/tab_contents/background_contents.h" | 36 #include "chrome/browser/tab_contents/background_contents.h" |
37 #include "chrome/browser/tab_contents/tab_util.h" | 37 #include "chrome/browser/tab_contents/tab_util.h" |
38 #include "chrome/browser/ui/browser.h" | 38 #include "chrome/browser/ui/browser.h" |
| 39 #include "chrome/browser/ui/browser_instant_controller.h" |
39 #include "chrome/browser/ui/browser_list.h" | 40 #include "chrome/browser/ui/browser_list.h" |
40 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 41 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
41 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" | 42 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
42 #include "chrome/browser/view_type_utils.h" | 43 #include "chrome/browser/view_type_utils.h" |
43 #include "chrome/common/chrome_notification_types.h" | 44 #include "chrome/common/chrome_notification_types.h" |
44 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
45 #include "chrome/common/extensions/extension.h" | 46 #include "chrome/common/extensions/extension.h" |
46 #include "chrome/common/render_messages.h" | 47 #include "chrome/common/render_messages.h" |
47 #include "chrome/common/url_constants.h" | 48 #include "chrome/common/url_constants.h" |
48 #include "content/public/browser/browser_child_process_host_iterator.h" | 49 #include "content/public/browser/browser_child_process_host_iterator.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 tab_contents->web_contents()->GetRenderProcessHost()->GetHandle(), | 233 tab_contents->web_contents()->GetRenderProcessHost()->GetHandle(), |
233 tab_contents->web_contents()->GetRenderViewHost()), | 234 tab_contents->web_contents()->GetRenderViewHost()), |
234 tab_contents_(tab_contents), | 235 tab_contents_(tab_contents), |
235 is_instant_preview_(false) { | 236 is_instant_preview_(false) { |
236 if (!prerender_icon_) { | 237 if (!prerender_icon_) { |
237 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 238 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
238 prerender_icon_ = rb.GetImageSkiaNamed(IDR_PRERENDER); | 239 prerender_icon_ = rb.GetImageSkiaNamed(IDR_PRERENDER); |
239 } | 240 } |
240 for (BrowserList::const_iterator i = BrowserList::begin(); | 241 for (BrowserList::const_iterator i = BrowserList::begin(); |
241 i != BrowserList::end(); ++i) { | 242 i != BrowserList::end(); ++i) { |
242 if ((*i)->instant() && | 243 if ((*i)->instant_controller()->instant() && |
243 (*i)->instant()->GetPreviewContents() == tab_contents_) { | 244 (*i)->instant_controller()->instant()->GetPreviewContents() == |
| 245 tab_contents_) { |
244 is_instant_preview_ = true; | 246 is_instant_preview_ = true; |
245 break; | 247 break; |
246 } | 248 } |
247 } | 249 } |
248 } | 250 } |
249 | 251 |
250 TaskManagerTabContentsResource::~TaskManagerTabContentsResource() { | 252 TaskManagerTabContentsResource::~TaskManagerTabContentsResource() { |
251 } | 253 } |
252 | 254 |
253 void TaskManagerTabContentsResource::InstantCommitted() { | 255 void TaskManagerTabContentsResource::InstantCommitted() { |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 | 1493 |
1492 return &resource_; | 1494 return &resource_; |
1493 } | 1495 } |
1494 | 1496 |
1495 void TaskManagerBrowserProcessResourceProvider::StartUpdating() { | 1497 void TaskManagerBrowserProcessResourceProvider::StartUpdating() { |
1496 task_manager_->AddResource(&resource_); | 1498 task_manager_->AddResource(&resource_); |
1497 } | 1499 } |
1498 | 1500 |
1499 void TaskManagerBrowserProcessResourceProvider::StopUpdating() { | 1501 void TaskManagerBrowserProcessResourceProvider::StopUpdating() { |
1500 } | 1502 } |
OLD | NEW |