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

Side by Side Diff: chrome/browser/history/history_backend.h

Issue 11099011: Prevent bookmarks from going out of sync part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « no previous file | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_
6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MigrationIconMapping); 494 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MigrationIconMapping);
495 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, 495 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
496 SetFaviconMappingsForPageAndRedirects); 496 SetFaviconMappingsForPageAndRedirects);
497 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, 497 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
498 SetFaviconMappingsForPageDuplicates); 498 SetFaviconMappingsForPageDuplicates);
499 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFavicons); 499 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFavicons);
500 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFaviconsDeleteBitmaps); 500 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFaviconsDeleteBitmaps);
501 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFaviconsReplaceBitmapData); 501 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFaviconsReplaceBitmapData);
502 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, 502 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
503 SetFaviconsSameFaviconURLForTwoPages); 503 SetFaviconsSameFaviconURLForTwoPages);
504 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
505 UpdateFaviconMappingsAndFetchNoChange);
504 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconPageURLNotInDB); 506 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconPageURLNotInDB);
505 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconPageURLInDB); 507 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconPageURLInDB);
506 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconMaxFaviconsPerPage); 508 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MergeFaviconMaxFaviconsPerPage);
507 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, 509 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
508 MergeFaviconMaxFaviconBitmapsPerIconURL); 510 MergeFaviconMaxFaviconBitmapsPerIconURL);
509 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, 511 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
510 UpdateFaviconMappingsAndFetchMultipleIconTypes); 512 UpdateFaviconMappingsAndFetchMultipleIconTypes);
511 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetFaviconsFromDBEmpty); 513 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetFaviconsFromDBEmpty);
512 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, 514 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest,
513 GetFaviconsFromDBNoFaviconBitmaps); 515 GetFaviconsFromDBNoFaviconBitmaps);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 const GURL* page_url, 643 const GURL* page_url,
642 const std::vector<GURL>& icon_urls, 644 const std::vector<GURL>& icon_urls,
643 int icon_types, 645 int icon_types,
644 int desired_size_in_dip, 646 int desired_size_in_dip,
645 const std::vector<ui::ScaleFactor>& desired_scale_factors); 647 const std::vector<ui::ScaleFactor>& desired_scale_factors);
646 648
647 // Set the favicon bitmaps for |icon_id|. 649 // Set the favicon bitmaps for |icon_id|.
648 // For each entry in |favicon_bitmap_data|, if a favicon bitmap already 650 // For each entry in |favicon_bitmap_data|, if a favicon bitmap already
649 // exists at the entry's pixel size, replace the favicon bitmap's data with 651 // exists at the entry's pixel size, replace the favicon bitmap's data with
650 // the entry's bitmap data. Otherwise add a new favicon bitmap. 652 // the entry's bitmap data. Otherwise add a new favicon bitmap.
651 // |favicon_bitmap_added| is set to true if the function has added a favicon
652 // bitmap.
653 void SetFaviconBitmaps( 653 void SetFaviconBitmaps(
654 FaviconID icon_id, 654 FaviconID icon_id,
655 const std::vector<FaviconBitmapData>& favicon_bitmap_data, 655 const std::vector<FaviconBitmapData>& favicon_bitmap_data);
656 bool* favicon_bitmap_added);
657 656
658 // Returns true if |favicon_bitmap_data| and |icon_url_sizes| passed to 657 // Returns true if |favicon_bitmap_data| and |icon_url_sizes| passed to
659 // SetFavicons() are valid. 658 // SetFavicons() are valid.
660 // Criteria: 659 // Criteria:
661 // 1) |icon_url_sizes| contains no more than 660 // 1) |icon_url_sizes| contains no more than
662 // kMaxFaviconsPerPage icon URLs. 661 // kMaxFaviconsPerPage icon URLs.
663 // kMaxFaviconBitmapsPerIconURL favicon sizes for each icon URL. 662 // kMaxFaviconBitmapsPerIconURL favicon sizes for each icon URL.
664 // 2) The icon URLs and favicon sizes of |favicon_bitmap_data| are a subset 663 // 2) The icon URLs and favicon sizes of |favicon_bitmap_data| are a subset
665 // of |icon_url_sizes|. 664 // of |icon_url_sizes|.
666 // 3) The favicon sizes for entries in |icon_url_sizes| which have associated 665 // 3) The favicon sizes for entries in |icon_url_sizes| which have associated
667 // data in |favicon_bitmap_data| is not history::GetDefaultFaviconSizes(). 666 // data in |favicon_bitmap_data| is not history::GetDefaultFaviconSizes().
668 // 4) FaviconBitmapData::bitmap_data contains non NULL bitmap data. 667 // 4) FaviconBitmapData::bitmap_data contains non NULL bitmap data.
669 bool ValidateSetFaviconsParams( 668 bool ValidateSetFaviconsParams(
670 const std::vector<FaviconBitmapData>& favicon_bitmap_data, 669 const std::vector<FaviconBitmapData>& favicon_bitmap_data,
671 const IconURLSizesMap& icon_url_sizes) const; 670 const IconURLSizesMap& icon_url_sizes) const;
672 671
673 // Sets the sizes that the thumbnail database knows that the favicon at 672 // Sets the sizes that the thumbnail database knows that the favicon at
674 // |icon_id| is available from the web. See history_types.h for a more 673 // |icon_id| is available from the web. See history_types.h for a more
675 // detailed description of FaviconSizes. 674 // detailed description of FaviconSizes.
676 // Deletes any favicon bitmaps currently mapped to |icon_id| whose pixel 675 // Deletes any favicon bitmaps currently mapped to |icon_id| whose pixel
677 // sizes are not contained in |favicon_sizes|. 676 // sizes are not contained in |favicon_sizes|.
678 // |favicon_bitmap_removed| is set to true if the function removed a favicon
679 // bitmap.
680 void SetFaviconSizes(FaviconID icon_id, 677 void SetFaviconSizes(FaviconID icon_id,
681 const FaviconSizes& favicon_sizes, 678 const FaviconSizes& favicon_sizes);
682 bool* favicon_bitmap_removed);
683 679
684 // Returns true if there are favicons for |page_url| and one of the types in 680 // Returns true if there are favicons for |page_url| and one of the types in
685 // |icon_types|. 681 // |icon_types|.
686 // |favicon_bitmap_results| is set to the favicon bitmaps which most closely 682 // |favicon_bitmap_results| is set to the favicon bitmaps which most closely
687 // match |desired_size_in_dip| and |desired_scale_factors|. If 683 // match |desired_size_in_dip| and |desired_scale_factors|. If
688 // |desired_size_in_dip| is 0, the largest favicon bitmap with one of the icon 684 // |desired_size_in_dip| is 0, the largest favicon bitmap with one of the icon
689 // types in |icon_types| is returned. If |icon_types| contains multiple icon 685 // types in |icon_types| is returned. If |icon_types| contains multiple icon
690 // types and there are several matched icon types in the database, results 686 // types and there are several matched icon types in the database, results
691 // will only be returned for a single icon type in the priority of 687 // will only be returned for a single icon type in the priority of
692 // TOUCH_PRECOMPOSED_ICON, TOUCH_ICON, and FAVICON. See the comment for 688 // TOUCH_PRECOMPOSED_ICON, TOUCH_ICON, and FAVICON. See the comment for
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 // Used to provide the Android ContentProvider APIs. 875 // Used to provide the Android ContentProvider APIs.
880 scoped_ptr<AndroidProviderBackend> android_provider_backend_; 876 scoped_ptr<AndroidProviderBackend> android_provider_backend_;
881 #endif 877 #endif
882 878
883 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); 879 DISALLOW_COPY_AND_ASSIGN(HistoryBackend);
884 }; 880 };
885 881
886 } // namespace history 882 } // namespace history
887 883
888 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ 884 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698