| OLD | NEW | 
|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MANIFEST_MANIFEST_ICON_SELECTOR_H_ | 5 #ifndef CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_ | 
| 6 #define CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_ | 6 #define CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_ | 
| 7 | 7 | 
| 8 #include "base/macros.h" | 8 #include "base/macros.h" | 
| 9 #include "content/public/common/manifest.h" | 9 #include "content/public/common/manifest.h" | 
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" | 
| 11 | 11 | 
| 12 namespace content { |  | 
| 13 class WebContents; |  | 
| 14 }  // namespace content |  | 
| 15 |  | 
| 16 namespace IPC { |  | 
| 17 class Message; |  | 
| 18 }  // namespace IPC |  | 
| 19 |  | 
| 20 namespace gfx { |  | 
| 21 class Screen; |  | 
| 22 } |  | 
| 23 |  | 
| 24 // Selects the icon most closely matching the size constraints.  This follows | 12 // Selects the icon most closely matching the size constraints.  This follows | 
| 25 // very basic heuristics -- improvements are welcome. | 13 // very basic heuristics -- improvements are welcome. | 
| 26 class ManifestIconSelector { | 14 class ManifestIconSelector { | 
| 27  public: | 15  public: | 
| 28   // Runs the algorithm to find the best matching icon in the icons listed in | 16   // Runs the algorithm to find the best matching icon in the icons listed in | 
| 29   // the Manifest. | 17   // the Manifest. | 
| 30   // | 18   // | 
| 31   // Size is defined in Android's density-independent pixels (dp): | 19   // Size is defined in Android's density-independent pixels (dp): | 
| 32   // http://developer.android.com/guide/practices/screens_support.html | 20   // http://developer.android.com/guide/practices/screens_support.html | 
| 33   // If/when this class is generalized, it may be a good idea to switch this to | 21   // If/when this class is generalized, it may be a good idea to switch this to | 
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 80 | 68 | 
| 81   const int ideal_icon_size_in_px_; | 69   const int ideal_icon_size_in_px_; | 
| 82   const int minimum_icon_size_in_px_; | 70   const int minimum_icon_size_in_px_; | 
| 83 | 71 | 
| 84   friend class ManifestIconSelectorTest; | 72   friend class ManifestIconSelectorTest; | 
| 85 | 73 | 
| 86   DISALLOW_COPY_AND_ASSIGN(ManifestIconSelector); | 74   DISALLOW_COPY_AND_ASSIGN(ManifestIconSelector); | 
| 87 }; | 75 }; | 
| 88 | 76 | 
| 89 #endif  // CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_ | 77 #endif  // CHROME_BROWSER_MANIFEST_MANIFEST_ICON_SELECTOR_H_ | 
| OLD | NEW | 
|---|