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/views/sad_tab_view.h" | 5 #include "chrome/browser/ui/views/sad_tab_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 const int kMessageFontSizeDelta = 0; | 46 const int kMessageFontSizeDelta = 0; |
47 #else | 47 #else |
48 const int kTitleFontSizeDelta = 2; | 48 const int kTitleFontSizeDelta = 2; |
49 const int kMessageFontSizeDelta = 1; | 49 const int kMessageFontSizeDelta = 1; |
50 #endif | 50 #endif |
51 | 51 |
52 // Name of the experiment to run. | 52 // Name of the experiment to run. |
53 const char kExperiment[] = "LowMemoryMargin"; | 53 const char kExperiment[] = "LowMemoryMargin"; |
54 | 54 |
55 #define EXPERIMENT_CUSTOM_COUNTS(name, sample, min, max, buckets) \ | 55 #define EXPERIMENT_CUSTOM_COUNTS(name, sample, min, max, buckets) \ |
56 UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, buckets); \ | 56 { \ |
57 if (base::FieldTrialList::TrialExists(kExperiment)) \ | 57 UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, buckets); \ |
58 UMA_HISTOGRAM_CUSTOM_COUNTS( \ | 58 if (base::FieldTrialList::TrialExists(kExperiment)) \ |
59 base::FieldTrial::MakeName(name, kExperiment), \ | 59 UMA_HISTOGRAM_CUSTOM_COUNTS( \ |
60 sample, min, max, buckets); | 60 base::FieldTrial::MakeName(name, kExperiment), \ |
| 61 sample, min, max, buckets); \ |
| 62 } |
61 | 63 |
62 } // namespace | 64 } // namespace |
63 | 65 |
64 SadTabView::SadTabView(WebContents* web_contents, Kind kind) | 66 SadTabView::SadTabView(WebContents* web_contents, Kind kind) |
65 : web_contents_(web_contents), | 67 : web_contents_(web_contents), |
66 kind_(kind), | 68 kind_(kind), |
67 painted_(false), | 69 painted_(false), |
68 base_font_(ui::ResourceBundle::GetSharedInstance().GetFont( | 70 base_font_(ui::ResourceBundle::GetSharedInstance().GetFont( |
69 ui::ResourceBundle::BaseFont)), | 71 ui::ResourceBundle::BaseFont)), |
70 message_(NULL), | 72 message_(NULL), |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 261 } |
260 | 262 |
261 views::Link* SadTabView::CreateLink(const string16& text) { | 263 views::Link* SadTabView::CreateLink(const string16& text) { |
262 views::Link* link = new views::Link(text); | 264 views::Link* link = new views::Link(text); |
263 link->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta)); | 265 link->SetFont(base_font_.DeriveFont(kMessageFontSizeDelta)); |
264 link->SetBackgroundColor(background()->get_color()); | 266 link->SetBackgroundColor(background()->get_color()); |
265 link->SetEnabledColor(kTextColor); | 267 link->SetEnabledColor(kTextColor); |
266 link->set_listener(this); | 268 link->set_listener(this); |
267 return link; | 269 return link; |
268 } | 270 } |
OLD | NEW |