Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: chrome/browser/history/history_tab_helper.cc

Issue 10332163: Revert 137075 - Get rid of Image::Image(SkBitmap*) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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(bitmap); 161 gfx::Image thumbnail(new SkBitmap(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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history_backend_unittest.cc ('k') | chrome/browser/history/top_sites_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698