diff options
author | pedrosimonetti@chromium.org <pedrosimonetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-11 11:54:44 +0000 |
---|---|---|
committer | pedrosimonetti@chromium.org <pedrosimonetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-11 11:54:44 +0000 |
commit | b4cba0f57def715e9a9db4defe0ab9776613d542 (patch) | |
tree | b02b1060168aad5de2819085b240996faabeea01 /chrome/browser/favicon | |
parent | f2eda3dfa1bfdecc30c5dff92fcade383a7b2341 (diff) | |
download | chromium_src-b4cba0f57def715e9a9db4defe0ab9776613d542.zip chromium_src-b4cba0f57def715e9a9db4defe0ab9776613d542.tar.gz chromium_src-b4cba0f57def715e9a9db4defe0ab9776613d542.tar.bz2 |
Preparation for supporting high dpi favicons in Instant Extended.
The logic in FaviconSource::ParsePath() has been moved from chrome/browser/ui/* to chrome/common/favicon* allowing it to be used from the renderer. Also, chrome/browser/favicon/favicon_types.h to chrome/common/favicon/favicon_types.h for the same reason.
Related internal CL: cl/46805180
To test this CL:
1) git cl patch 15388002
2) ./build/gyp_chromium
2) compile chrome
3) run chrome with --enable-instant-extended-api
BUG=227087
Review URL: https://chromiumcodereview.appspot.com/15388002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211085 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/favicon')
-rw-r--r-- | chrome/browser/favicon/DEPS | 2 | ||||
-rw-r--r-- | chrome/browser/favicon/favicon_service.cc | 3 | ||||
-rw-r--r-- | chrome/browser/favicon/favicon_service.h | 2 | ||||
-rw-r--r-- | chrome/browser/favicon/favicon_types.cc | 23 | ||||
-rw-r--r-- | chrome/browser/favicon/favicon_types.h | 77 | ||||
-rw-r--r-- | chrome/browser/favicon/favicon_util.cc | 2 |
6 files changed, 4 insertions, 105 deletions
diff --git a/chrome/browser/favicon/DEPS b/chrome/browser/favicon/DEPS index 2ed7139..a317574 100644 --- a/chrome/browser/favicon/DEPS +++ b/chrome/browser/favicon/DEPS @@ -32,8 +32,8 @@ specific_include_rules = { 'favicon_util\.(h|cc)': [ "-chrome", "-chrome/browser", - "+chrome/browser/favicon/favicon_types.h", "+chrome/browser/favicon/favicon_util.h", + "+chrome/common/favicon/favicon_types.h", "+chrome/common/icon_messages.h", "!chrome/browser/history/history_types.h", "!chrome/browser/history/select_favicon_frames.h", diff --git a/chrome/browser/favicon/favicon_service.cc b/chrome/browser/favicon/favicon_service.cc index dc4cab9..555cdb1 100644 --- a/chrome/browser/favicon/favicon_service.cc +++ b/chrome/browser/favicon/favicon_service.cc @@ -6,13 +6,13 @@ #include "base/hash.h" #include "base/message_loop/message_loop_proxy.h" -#include "chrome/browser/favicon/favicon_types.h" #include "chrome/browser/favicon/favicon_util.h" #include "chrome/browser/history/history_backend.h" #include "chrome/browser/history/history_service.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/history/select_favicon_frames.h" #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" +#include "chrome/common/favicon/favicon_types.h" #include "chrome/common/importer/imported_favicon_usage.h" #include "chrome/common/url_constants.h" #include "extensions/common/constants.h" @@ -371,4 +371,3 @@ void FaviconService::RunFaviconRawCallbackWithBitmapResults( &resized_bitmap_data); callback.Run(bitmap_result); } - diff --git a/chrome/browser/favicon/favicon_service.h b/chrome/browser/favicon/favicon_service.h index dc13360..692a6eb 100644 --- a/chrome/browser/favicon/favicon_service.h +++ b/chrome/browser/favicon/favicon_service.h @@ -11,8 +11,8 @@ #include "base/containers/hash_tables.h" #include "base/memory/ref_counted.h" #include "chrome/browser/common/cancelable_request.h" -#include "chrome/browser/favicon/favicon_types.h" #include "chrome/common/cancelable_task_tracker.h" +#include "chrome/common/favicon/favicon_types.h" #include "chrome/common/ref_counted_util.h" #include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "ui/base/layout.h" diff --git a/chrome/browser/favicon/favicon_types.cc b/chrome/browser/favicon/favicon_types.cc deleted file mode 100644 index ca49db8..0000000 --- a/chrome/browser/favicon/favicon_types.cc +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/favicon/favicon_types.h" - -namespace chrome { - -// FaviconImageResult --------------------------------------------------------- - -FaviconImageResult::FaviconImageResult() {} - -FaviconImageResult::~FaviconImageResult() {} - -// FaviconBitmapResult -------------------------------------------------------- - -FaviconBitmapResult::FaviconBitmapResult() - : expired(false), - icon_type(INVALID_ICON) {} - -FaviconBitmapResult::~FaviconBitmapResult() {} - -} // namespace chrome diff --git a/chrome/browser/favicon/favicon_types.h b/chrome/browser/favicon/favicon_types.h deleted file mode 100644 index 16724e0..0000000 --- a/chrome/browser/favicon/favicon_types.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_FAVICON_FAVICON_TYPES_H_ -#define CHROME_BROWSER_FAVICON_FAVICON_TYPES_H_ - -#include "base/memory/ref_counted_memory.h" -#include "ui/gfx/image/image.h" -#include "ui/gfx/size.h" -#include "url/gurl.h" - -namespace chrome { - -typedef int64 FaviconID; - -// Defines the icon types. They are also stored in icon_type field of favicons -// table. -// The values of the IconTypes are used to select the priority in which favicon -// data is returned in HistoryBackend and ThumbnailDatabase. Data for the -// largest IconType takes priority if data for multiple IconTypes is available. -enum IconType { - INVALID_ICON = 0x0, - FAVICON = 1 << 0, - TOUCH_ICON = 1 << 1, - TOUCH_PRECOMPOSED_ICON = 1 << 2 -}; - -// Defines a gfx::Image of size desired_size_in_dip composed of image -// representations for each of the desired scale factors. -struct FaviconImageResult { - FaviconImageResult(); - ~FaviconImageResult(); - - // The resulting image. - gfx::Image image; - - // The URL of the favicon which contains all of the image representations of - // |image|. - // TODO(pkotwicz): Return multiple |icon_urls| to allow |image| to have - // representations from several favicons once content::FaviconStatus supports - // multiple URLs. - GURL icon_url; -}; - -// Defines a favicon bitmap which best matches the desired DIP size and one of -// the desired scale factors. -struct FaviconBitmapResult { - FaviconBitmapResult(); - ~FaviconBitmapResult(); - - // Returns true if |bitmap_data| contains a valid bitmap. - bool is_valid() const { return bitmap_data.get() && bitmap_data->size(); } - - // Indicates whether |bitmap_data| is expired. - bool expired; - - // The bits of the bitmap. - scoped_refptr<base::RefCountedMemory> bitmap_data; - - // The pixel dimensions of |bitmap_data|. - gfx::Size pixel_size; - - // The URL of the containing favicon. - GURL icon_url; - - // The icon type of the containing favicon. - IconType icon_type; -}; - -// Define type with same structure as FaviconBitmapResult for passing data to -// HistoryBackend::SetFavicons(). -typedef FaviconBitmapResult FaviconBitmapData; - -} // namespace chrome - -#endif // CHROME_BROWSER_FAVICON_FAVICON_TYPES_H_ diff --git a/chrome/browser/favicon/favicon_util.cc b/chrome/browser/favicon/favicon_util.cc index 21c9d75..456df8f6 100644 --- a/chrome/browser/favicon/favicon_util.cc +++ b/chrome/browser/favicon/favicon_util.cc @@ -4,8 +4,8 @@ #include "chrome/browser/favicon/favicon_util.h" -#include "chrome/browser/favicon/favicon_types.h" #include "chrome/browser/history/select_favicon_frames.h" +#include "chrome/common/favicon/favicon_types.h" #include "content/public/browser/render_view_host.h" #include "content/public/child/image_decoder_utils.h" #include "skia/ext/image_operations.h" |