| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/media/tab_desktop_media_list.h" | 5 #include "chrome/browser/media/tab_desktop_media_list.h" |
| 6 | 6 |
| 7 #include "base/hash.h" | 7 #include "base/hash.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
| 9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 browsers.push_back(browser); | 80 browsers.push_back(browser); |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 ImageHashesMap new_favicon_hashes; | 84 ImageHashesMap new_favicon_hashes; |
| 85 std::vector<SourceDescription> sources; | 85 std::vector<SourceDescription> sources; |
| 86 std::map<base::TimeTicks, SourceDescription> tab_map; | 86 std::map<base::TimeTicks, SourceDescription> tab_map; |
| 87 std::vector<std::pair<DesktopMediaID, gfx::ImageSkia>> favicon_pairs; | 87 std::vector<std::pair<DesktopMediaID, gfx::ImageSkia>> favicon_pairs; |
| 88 | 88 |
| 89 // Enumerate all tabs with their titles and favicons for a user profile. | 89 // Enumerate all tabs with their titles and favicons for a user profile. |
| 90 for (auto browser : browsers) { | 90 for (auto* browser : browsers) { |
| 91 const TabStripModel* tab_strip_model = browser->tab_strip_model(); | 91 const TabStripModel* tab_strip_model = browser->tab_strip_model(); |
| 92 DCHECK(tab_strip_model); | 92 DCHECK(tab_strip_model); |
| 93 | 93 |
| 94 for (int i = 0; i < tab_strip_model->count(); i++) { | 94 for (int i = 0; i < tab_strip_model->count(); i++) { |
| 95 // Create id for tab. | 95 // Create id for tab. |
| 96 content::WebContents* contents = tab_strip_model->GetWebContentsAt(i); | 96 content::WebContents* contents = tab_strip_model->GetWebContentsAt(i); |
| 97 DCHECK(contents); | 97 DCHECK(contents); |
| 98 content::RenderFrameHost* main_frame = contents->GetMainFrame(); | 98 content::RenderFrameHost* main_frame = contents->GetMainFrame(); |
| 99 DCHECK(main_frame); | 99 DCHECK(main_frame); |
| 100 DesktopMediaID media_id( | 100 DesktopMediaID media_id( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 // ScheduleNextRefresh() needs to be called after all calls for | 148 // ScheduleNextRefresh() needs to be called after all calls for |
| 149 // UpdateSourceThumbnail() have done. Therefore, a DoNothing task is posted | 149 // UpdateSourceThumbnail() have done. Therefore, a DoNothing task is posted |
| 150 // to the same sequenced task runner that CreateEnlargedFaviconImag() | 150 // to the same sequenced task runner that CreateEnlargedFaviconImag() |
| 151 // is posted. | 151 // is posted. |
| 152 thumbnail_task_runner_.get()->PostTaskAndReply( | 152 thumbnail_task_runner_.get()->PostTaskAndReply( |
| 153 FROM_HERE, base::Bind(&base::DoNothing), | 153 FROM_HERE, base::Bind(&base::DoNothing), |
| 154 base::Bind(&TabDesktopMediaList::ScheduleNextRefresh, | 154 base::Bind(&TabDesktopMediaList::ScheduleNextRefresh, |
| 155 weak_factory_.GetWeakPtr())); | 155 weak_factory_.GetWeakPtr())); |
| 156 } | 156 } |
| OLD | NEW |