OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/importer/importer.h" | 5 #include "chrome/browser/importer/importer.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "app/gfx/favicon_size.h" | 10 #include "app/gfx/favicon_size.h" |
| 11 #include "app/gfx/codec/png_codec.h" |
11 #include "app/l10n_util.h" | 12 #include "app/l10n_util.h" |
12 #include "base/file_util.h" | 13 #include "base/file_util.h" |
13 #include "base/gfx/png_encoder.h" | |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "chrome/browser/bookmarks/bookmark_model.h" | 16 #include "chrome/browser/bookmarks/bookmark_model.h" |
17 #include "chrome/browser/browser.h" | 17 #include "chrome/browser/browser.h" |
18 #include "chrome/browser/browser_list.h" | 18 #include "chrome/browser/browser_list.h" |
19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
20 #include "chrome/browser/favicon_service.h" | 20 #include "chrome/browser/favicon_service.h" |
21 #include "chrome/browser/first_run.h" | 21 #include "chrome/browser/first_run.h" |
22 #include "chrome/browser/importer/firefox2_importer.h" | 22 #include "chrome/browser/importer/firefox2_importer.h" |
23 #include "chrome/browser/importer/firefox3_importer.h" | 23 #include "chrome/browser/importer/firefox3_importer.h" |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 if (decoded.width() != kFavIconSize || decoded.height() != kFavIconSize) { | 418 if (decoded.width() != kFavIconSize || decoded.height() != kFavIconSize) { |
419 // The bitmap is not the correct size, re-sample. | 419 // The bitmap is not the correct size, re-sample. |
420 int new_width = decoded.width(); | 420 int new_width = decoded.width(); |
421 int new_height = decoded.height(); | 421 int new_height = decoded.height(); |
422 calc_favicon_target_size(&new_width, &new_height); | 422 calc_favicon_target_size(&new_width, &new_height); |
423 decoded = skia::ImageOperations::Resize( | 423 decoded = skia::ImageOperations::Resize( |
424 decoded, skia::ImageOperations::RESIZE_LANCZOS3, new_width, new_height); | 424 decoded, skia::ImageOperations::RESIZE_LANCZOS3, new_width, new_height); |
425 } | 425 } |
426 | 426 |
427 // Encode our bitmap as a PNG. | 427 // Encode our bitmap as a PNG. |
428 PNGEncoder::EncodeBGRASkBitmap(decoded, false, png_data); | 428 gfx::PNGCodec::EncodeBGRASkBitmap(decoded, false, png_data); |
429 return true; | 429 return true; |
430 } | 430 } |
431 | 431 |
432 // ImporterHost. | 432 // ImporterHost. |
433 | 433 |
434 ImporterHost::ImporterHost() | 434 ImporterHost::ImporterHost() |
435 : observer_(NULL), | 435 : observer_(NULL), |
436 task_(NULL), | 436 task_(NULL), |
437 importer_(NULL), | 437 importer_(NULL), |
438 file_loop_(g_browser_process->file_thread()->message_loop()), | 438 file_loop_(g_browser_process->file_thread()->message_loop()), |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 ProfileInfo* safari = new ProfileInfo(); | 839 ProfileInfo* safari = new ProfileInfo(); |
840 safari->browser_type = SAFARI; | 840 safari->browser_type = SAFARI; |
841 safari->description = l10n_util::GetString(IDS_IMPORT_FROM_SAFARI); | 841 safari->description = l10n_util::GetString(IDS_IMPORT_FROM_SAFARI); |
842 safari->source_path.clear(); | 842 safari->source_path.clear(); |
843 safari->app_path.clear(); | 843 safari->app_path.clear(); |
844 safari->services_supported = items; | 844 safari->services_supported = items; |
845 source_profiles_.push_back(safari); | 845 source_profiles_.push_back(safari); |
846 } | 846 } |
847 } | 847 } |
848 #endif // OS_MACOSX | 848 #endif // OS_MACOSX |
OLD | NEW |