| 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/history/history_tab_helper.h" | 5 #include "chrome/browser/history/history_tab_helper.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/browser/history/history.h" | 9 #include "chrome/browser/history/history.h" |
| 10 #include "chrome/browser/history/top_sites.h" | 10 #include "chrome/browser/history/top_sites.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 const ThumbnailScore& score, | 151 const ThumbnailScore& score, |
| 152 const SkBitmap& bitmap) { | 152 const SkBitmap& bitmap) { |
| 153 Profile* profile = | 153 Profile* profile = |
| 154 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 154 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| 155 if (profile->IsOffTheRecord()) | 155 if (profile->IsOffTheRecord()) |
| 156 return; | 156 return; |
| 157 | 157 |
| 158 // Tell History about this thumbnail. | 158 // Tell History about this thumbnail. |
| 159 history::TopSites* ts = profile->GetTopSites(); | 159 history::TopSites* ts = profile->GetTopSites(); |
| 160 if (ts) { | 160 if (ts) { |
| 161 gfx::Image thumbnail(new SkBitmap(bitmap)); | 161 gfx::Image thumbnail(bitmap); |
| 162 ts->SetPageThumbnail(url, &thumbnail, score); | 162 ts->SetPageThumbnail(url, &thumbnail, score); |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 | 165 |
| 166 HistoryService* HistoryTabHelper::GetHistoryService() { | 166 HistoryService* HistoryTabHelper::GetHistoryService() { |
| 167 Profile* profile = | 167 Profile* profile = |
| 168 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 168 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| 169 if (profile->IsOffTheRecord()) | 169 if (profile->IsOffTheRecord()) |
| 170 return NULL; | 170 return NULL; |
| 171 | 171 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 182 | 182 |
| 183 HistoryService* hs = profile->GetHistoryService(Profile::IMPLICIT_ACCESS); | 183 HistoryService* hs = profile->GetHistoryService(Profile::IMPLICIT_ACCESS); |
| 184 if (hs) { | 184 if (hs) { |
| 185 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry(); | 185 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry(); |
| 186 if (entry) { | 186 if (entry) { |
| 187 hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(), | 187 hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(), |
| 188 base::Time::Now()); | 188 base::Time::Now()); |
| 189 } | 189 } |
| 190 } | 190 } |
| 191 } | 191 } |
| OLD | NEW |