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

Side by Side Diff: components/favicon_base/favicon_util.h

Issue 335233003: Convert ui::ScaleFactor -> float in favicon/history code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_FAVICON_BASE_FAVICON_UTIL_H_ 5 #ifndef COMPONENTS_FAVICON_BASE_FAVICON_UTIL_H_
6 #define COMPONENTS_FAVICON_BASE_FAVICON_UTIL_H_ 6 #define COMPONENTS_FAVICON_BASE_FAVICON_UTIL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "components/favicon_base/favicon_types.h" 10 #include "components/favicon_base/favicon_types.h"
11 #include "ui/base/layout.h"
12 11
13 namespace gfx { 12 namespace gfx {
14 class Image; 13 class Image;
15 } 14 }
16 15
17 namespace favicon_base { 16 namespace favicon_base {
18 17
19 // Returns the scale factors at which favicons should be fetched. This is 18 // Returns the scales at which favicons should be fetched. This is
20 // different from ui::GetSupportedScaleFactors() because clients which do 19 // different from ui::GetSupportedScaleFactors() because clients which do
21 // not support 1x should still fetch a favicon for 1x to push to sync. This 20 // not support 1x should still fetch a favicon for 1x to push to sync. This
22 // guarantees that the clients receiving sync updates pushed by this client 21 // guarantees that the clients receiving sync updates pushed by this client
23 // receive a favicon (potentially of the wrong scale factor) and do not show 22 // receive a favicon (potentially of the wrong scale factor) and do not show
24 // the default favicon. 23 // the default favicon.
25 std::vector<ui::ScaleFactor> GetFaviconScaleFactors(); 24 std::vector<float> GetFaviconScales();
26 25
27 // Sets the color space used for converting |image| to an NSImage to the 26 // Sets the color space used for converting |image| to an NSImage to the
28 // system colorspace. This makes the favicon look the same in the browser UI 27 // system colorspace. This makes the favicon look the same in the browser UI
29 // as it does in the renderer. 28 // as it does in the renderer.
30 void SetFaviconColorSpace(gfx::Image* image); 29 void SetFaviconColorSpace(gfx::Image* image);
31 30
32 // Takes a vector of png-encoded frames, decodes them, and converts them to 31 // Takes a vector of png-encoded frames, decodes them, and converts them to
33 // a favicon of size favicon_size (in DIPs) at the desired ui scale factors. 32 // a favicon of size favicon_size (in DIPs) at the desired ui scale factors.
pkotwicz 2014/06/20 00:35:41 I think that this is a better comment: "Takes a ve
oshima 2014/06/20 04:16:34 Updated to the slightly modified version.
pkotwicz 2014/06/20 14:22:36 This method does not always decode the PNG encoded
oshima 2014/06/20 15:21:50 I see, done.
34 gfx::Image SelectFaviconFramesFromPNGs( 33 gfx::Image SelectFaviconFramesFromPNGs(
35 const std::vector<favicon_base::FaviconRawBitmapResult>& png_data, 34 const std::vector<favicon_base::FaviconRawBitmapResult>& png_data,
36 const std::vector<ui::ScaleFactor>& scale_factors, 35 const std::vector<float>& favicon_scales,
37 int favicon_size); 36 int favicon_size);
38 37
39 } // namspace favicon_base 38 } // namspace favicon_base
40 39
41 #endif // COMPONENTS_FAVICON_BASE_FAVICON_UTIL_H_ 40 #endif // COMPONENTS_FAVICON_BASE_FAVICON_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698