OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/i18n/icu_util.h" | 14 #include "base/i18n/icu_util.h" |
15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/process_util.h" | 17 #include "base/process_util.h" |
18 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
19 #include "base/time.h" | 19 #include "base/time.h" |
20 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
21 #include "chrome/browser/history/history.h" | 21 #include "chrome/browser/history/history.h" |
22 #include "chrome/browser/history/top_sites.h" | 22 #include "chrome/browser/history/top_sites.h" |
23 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
24 #include "chrome/common/thumbnail_score.h" | 24 #include "chrome/common/thumbnail_score.h" |
25 #include "chrome/test/base/testing_profile.h" | 25 #include "chrome/test/base/testing_profile.h" |
26 #include "content/browser/browser_thread_impl.h" | |
27 #include "content/browser/notification_service_impl.h" | 26 #include "content/browser/notification_service_impl.h" |
28 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
29 #include "third_party/skia/include/core/SkBitmap.h" | 28 #include "third_party/skia/include/core/SkBitmap.h" |
30 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
31 #include "ui/base/ui_base_paths.h" | 30 #include "ui/base/ui_base_paths.h" |
32 #include "ui/gfx/codec/jpeg_codec.h" | 31 #include "ui/gfx/codec/jpeg_codec.h" |
33 | 32 |
34 using base::Time; | 33 using base::Time; |
35 using content::BrowserThread; | 34 using content::BrowserThread; |
36 | 35 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 ::GetLastError()); | 229 ::GetLastError()); |
231 } | 230 } |
232 | 231 |
233 icu_util::Initialize(); | 232 icu_util::Initialize(); |
234 | 233 |
235 chrome::RegisterPathProvider(); | 234 chrome::RegisterPathProvider(); |
236 ui::RegisterPathProvider(); | 235 ui::RegisterPathProvider(); |
237 ResourceBundle::InitSharedInstance("en-US"); | 236 ResourceBundle::InitSharedInstance("en-US"); |
238 NotificationServiceImpl notification_service; | 237 NotificationServiceImpl notification_service; |
239 MessageLoopForUI message_loop; | 238 MessageLoopForUI message_loop; |
240 content::BrowserThreadImpl ui_thread(BrowserThread::UI, &message_loop); | 239 content::DeprecatedBrowserThread ui_thread(BrowserThread::UI, &message_loop); |
241 content::BrowserThreadImpl db_thread(BrowserThread::DB, &message_loop); | 240 content::DeprecatedBrowserThread db_thread(BrowserThread::DB, &message_loop); |
242 TestingProfile profile; | 241 TestingProfile profile; |
243 profile.CreateHistoryService(false, false); | 242 profile.CreateHistoryService(false, false); |
244 if (types & TOP_SITES) { | 243 if (types & TOP_SITES) { |
245 profile.CreateTopSites(); | 244 profile.CreateTopSites(); |
246 profile.BlockUntilTopSitesLoaded(); | 245 profile.BlockUntilTopSitesLoaded(); |
247 } | 246 } |
248 | 247 |
249 srand(static_cast<unsigned int>(Time::Now().ToInternalValue())); | 248 srand(static_cast<unsigned int>(Time::Now().ToInternalValue())); |
250 | 249 |
251 // The maximum number of URLs to insert into history in one batch. | 250 // The maximum number of URLs to insert into history in one batch. |
(...skipping 26 matching lines...) Expand all Loading... |
278 dst_file.value().c_str()); | 277 dst_file.value().c_str()); |
279 if (!file_util::CopyFile(path, dst_file)) { | 278 if (!file_util::CopyFile(path, dst_file)) { |
280 printf("Copying file failed: %d\n", ::GetLastError()); | 279 printf("Copying file failed: %d\n", ::GetLastError()); |
281 return -1; | 280 return -1; |
282 } | 281 } |
283 path = file_iterator.Next(); | 282 path = file_iterator.Next(); |
284 } | 283 } |
285 | 284 |
286 return 0; | 285 return 0; |
287 } | 286 } |
OLD | NEW |