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

Side by Side Diff: chrome/tools/profiles/generate_profile.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 // This program generates a user profile and history by randomly generating 5 // This program generates a user profile and history by randomly generating
6 // data and feeding it to the history service. 6 // data and feeding it to the history service.
7 7
8 #include "chrome/tools/profiles/thumbnail-inl.h" 8 #include "chrome/tools/profiles/thumbnail-inl.h"
9 9
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // Add all of this information to the history service. 174 // Add all of this information to the history service.
175 history_service->AddPage(url, 175 history_service->AddPage(url,
176 id_scope, page_id, 176 id_scope, page_id,
177 previous_url, transition, 177 previous_url, transition,
178 redirects, history::SOURCE_BROWSED, true); 178 redirects, history::SOURCE_BROWSED, true);
179 ThumbnailScore score(0.75, false, false); 179 ThumbnailScore score(0.75, false, false);
180 history_service->SetPageTitle(url, ConstructRandomTitle()); 180 history_service->SetPageTitle(url, ConstructRandomTitle());
181 if (types & FULL_TEXT) 181 if (types & FULL_TEXT)
182 history_service->SetPageContents(url, ConstructRandomPage()); 182 history_service->SetPageContents(url, ConstructRandomPage());
183 if (types & TOP_SITES && top_sites) { 183 if (types & TOP_SITES && top_sites) {
184 const SkBitmap& bitmap = (RandomInt(0, 2) == 0) ? *google_bitmap : 184 SkBitmap* bitmap = (RandomInt(0, 2) == 0) ? google_bitmap.get() :
185 *weewar_bitmap; 185 weewar_bitmap.get();
186 gfx::Image image(bitmap); 186 gfx::Image image(new SkBitmap(*bitmap));
187 top_sites->SetPageThumbnail(url, &image, score); 187 top_sites->SetPageThumbnail(url, &image, score);
188 } 188 }
189 189
190 previous_url = url; 190 previous_url = url;
191 191
192 if (revisit_urls.empty() || RandomFloat() < kRevisitableURLProbability) 192 if (revisit_urls.empty() || RandomFloat() < kRevisitableURLProbability)
193 revisit_urls.push_back(url); 193 revisit_urls.push_back(url);
194 } 194 }
195 } 195 }
196 196
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 dst_file.value().c_str()); 279 dst_file.value().c_str());
280 if (!file_util::CopyFile(path, dst_file)) { 280 if (!file_util::CopyFile(path, dst_file)) {
281 printf("Copying file failed: %d\n", ::GetLastError()); 281 printf("Copying file failed: %d\n", ::GetLastError());
282 return -1; 282 return -1;
283 } 283 }
284 path = file_iterator.Next(); 284 path = file_iterator.Next();
285 } 285 }
286 286
287 return 0; 287 return 0;
288 } 288 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/intents/web_intent_picker_controller.cc ('k') | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698