OLD | NEW |
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 #include "chrome/browser/ui/intents/web_intent_picker.h" | 5 #include "chrome/browser/ui/intents/web_intent_picker.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 #include "content/public/browser/web_contents_view.h" | 10 #include "content/public/browser/web_contents_view.h" |
11 #include "grit/theme_resources.h" | 11 #include "grit/theme_resources_standard.h" |
12 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 // The minimum width of the inline disposition tab contents. | 16 // The minimum width of the inline disposition tab contents. |
17 const int kMinInlineDispositionWidth = 300; | 17 const int kMinInlineDispositionWidth = 300; |
18 | 18 |
19 // The minimum height of the inline disposition tab contents. | 19 // The minimum height of the inline disposition tab contents. |
20 const int kMinInlineDispositionHeight = 150; | 20 const int kMinInlineDispositionHeight = 150; |
21 | 21 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 // We don't need to test against the upper bound (kHalfStarMax); when the | 64 // We don't need to test against the upper bound (kHalfStarMax); when the |
65 // fractional part is greater than kHalfStarMax, full_stars will be rounded | 65 // fractional part is greater than kHalfStarMax, full_stars will be rounded |
66 // up, which means rating - full_stars is negative. | 66 // up, which means rating - full_stars is negative. |
67 bool half_star = rating - full_stars >= kHalfStarMin; | 67 bool half_star = rating - full_stars >= kHalfStarMin; |
68 | 68 |
69 return index == full_stars && half_star ? | 69 return index == full_stars && half_star ? |
70 IDR_CWS_STAR_HALF : | 70 IDR_CWS_STAR_HALF : |
71 IDR_CWS_STAR_EMPTY; | 71 IDR_CWS_STAR_EMPTY; |
72 } | 72 } |
OLD | NEW |