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

Side by Side Diff: chrome/browser/ui/intents/web_intent_picker.cc

Issue 10824102: Web Intents Picker: Set minimum size of the inline disposition to 1x1 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | 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 #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.h"
12 #include "ui/gfx/size.h" 12 #include "ui/gfx/size.h"
13 13
14 namespace { 14 namespace {
15 15
16 // Maximum inline disposition container sizes. 16 // Maximum inline disposition container sizes.
17 const int kMaxInlineDispositionWidth = 900; 17 const int kMaxInlineDispositionWidth = 900;
18 const int kMaxInlineDispositionHeight = 900; 18 const int kMaxInlineDispositionHeight = 900;
19 19
20 } // namespace 20 } // namespace
21 21
22 // static 22 // static
23 gfx::Size WebIntentPicker::GetMinInlineDispositionSize() { 23 gfx::Size WebIntentPicker::GetMinInlineDispositionSize() {
24 return gfx::Size(0, 0); 24 return gfx::Size(1, 1);
25 } 25 }
26 26
27 // static 27 // static
28 gfx::Size WebIntentPicker::GetMaxInlineDispositionSize() { 28 gfx::Size WebIntentPicker::GetMaxInlineDispositionSize() {
29 return gfx::Size(kMaxInlineDispositionWidth, kMaxInlineDispositionHeight); 29 return gfx::Size(kMaxInlineDispositionWidth, kMaxInlineDispositionHeight);
30 } 30 }
31 31
32 // static 32 // static
33 int WebIntentPicker::GetNthStarImageIdFromCWSRating(double rating, int index) { 33 int WebIntentPicker::GetNthStarImageIdFromCWSRating(double rating, int index) {
34 // The fractional part of the rating is converted to stars as: 34 // The fractional part of the rating is converted to stars as:
(...skipping 11 matching lines...) Expand all
46 46
47 // We don't need to test against the upper bound (kHalfStarMax); when the 47 // We don't need to test against the upper bound (kHalfStarMax); when the
48 // fractional part is greater than kHalfStarMax, full_stars will be rounded 48 // fractional part is greater than kHalfStarMax, full_stars will be rounded
49 // up, which means rating - full_stars is negative. 49 // up, which means rating - full_stars is negative.
50 bool half_star = rating - full_stars >= kHalfStarMin; 50 bool half_star = rating - full_stars >= kHalfStarMin;
51 51
52 return index == full_stars && half_star ? 52 return index == full_stars && half_star ?
53 IDR_CWS_STAR_HALF : 53 IDR_CWS_STAR_HALF :
54 IDR_CWS_STAR_EMPTY; 54 IDR_CWS_STAR_EMPTY;
55 } 55 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698