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

Side by Side Diff: chrome/browser/bookmarks/bookmark_model.cc

Issue 243076: Move the JPEG and PNG codecs from base/gfx to app/gfx/codec. Move the classes... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/bookmarks/bookmark_model.h" 5 #include "chrome/browser/bookmarks/bookmark_model.h"
6 6
7 #include "app/gfx/codec/png_codec.h"
7 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
8 #include "base/gfx/png_decoder.h"
9 #include "base/scoped_vector.h" 9 #include "base/scoped_vector.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 #include "chrome/browser/bookmarks/bookmark_index.h" 11 #include "chrome/browser/bookmarks/bookmark_index.h"
12 #include "chrome/browser/bookmarks/bookmark_utils.h" 12 #include "chrome/browser/bookmarks/bookmark_utils.h"
13 #include "chrome/browser/bookmarks/bookmark_storage.h" 13 #include "chrome/browser/bookmarks/bookmark_storage.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/profile.h" 15 #include "chrome/browser/profile.h"
16 #include "chrome/common/notification_service.h" 16 #include "chrome/common/notification_service.h"
17 #include "chrome/common/pref_service.h" 17 #include "chrome/common/pref_service.h"
18 #include "grit/generated_resources.h" 18 #include "grit/generated_resources.h"
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 scoped_refptr<RefCountedBytes> data, 637 scoped_refptr<RefCountedBytes> data,
638 bool expired, 638 bool expired,
639 GURL icon_url) { 639 GURL icon_url) {
640 SkBitmap fav_icon; 640 SkBitmap fav_icon;
641 BookmarkNode* node = 641 BookmarkNode* node =
642 load_consumer_.GetClientData( 642 load_consumer_.GetClientData(
643 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS), handle); 643 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS), handle);
644 DCHECK(node); 644 DCHECK(node);
645 node->set_favicon_load_handle(0); 645 node->set_favicon_load_handle(0);
646 if (know_favicon && data.get() && 646 if (know_favicon && data.get() &&
647 PNGDecoder::Decode(&data->data, &fav_icon)) { 647 gfx::PNGCodec::Decode(&data->data, &fav_icon)) {
648 node->set_favicon(fav_icon); 648 node->set_favicon(fav_icon);
649 FavIconLoaded(node); 649 FavIconLoaded(node);
650 } 650 }
651 } 651 }
652 652
653 void BookmarkModel::LoadFavIcon(BookmarkNode* node) { 653 void BookmarkModel::LoadFavIcon(BookmarkNode* node) {
654 if (node->GetType() != BookmarkNode::URL) 654 if (node->GetType() != BookmarkNode::URL)
655 return; 655 return;
656 656
657 DCHECK(node->GetURL().is_valid()); 657 DCHECK(node->GetURL().is_valid());
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 void BookmarkModel::SetFileChanged() { 721 void BookmarkModel::SetFileChanged() {
722 file_changed_ = true; 722 file_changed_ = true;
723 } 723 }
724 724
725 BookmarkStorage::LoadDetails* BookmarkModel::CreateLoadDetails() { 725 BookmarkStorage::LoadDetails* BookmarkModel::CreateLoadDetails() {
726 BookmarkNode* bb_node = CreateBookmarkNode(); 726 BookmarkNode* bb_node = CreateBookmarkNode();
727 BookmarkNode* other_folder_node = CreateOtherBookmarksNode(); 727 BookmarkNode* other_folder_node = CreateOtherBookmarksNode();
728 return new BookmarkStorage::LoadDetails( 728 return new BookmarkStorage::LoadDetails(
729 bb_node, other_folder_node, new BookmarkIndex(profile()), next_node_id_); 729 bb_node, other_folder_node, new BookmarkIndex(profile()), next_node_id_);
730 } 730 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698