| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/critical_notification_bubble_view.h" | 5 #include "chrome/browser/ui/views/critical_notification_bubble_view.h" |
| 6 | 6 |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| 11 #include "chrome/browser/ui/browser_list.h" | 11 #include "chrome/browser/ui/browser_list.h" |
| 12 #include "chrome/browser/upgrade_detector.h" | 12 #include "chrome/browser/upgrade_detector.h" |
| 13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 14 #include "content/browser/user_metrics.h" | 14 #include "content/browser/user_metrics.h" |
| 15 #include "grit/chromium_strings.h" | 15 #include "grit/chromium_strings.h" |
| 16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
| 17 #include "grit/locale_settings.h" | 17 #include "grit/locale_settings.h" |
| 18 #include "grit/theme_resources.h" | 18 #include "grit/theme_resources.h" |
| 19 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
| 20 #include "ui/base/models/accelerator.h" | 20 #include "ui/base/models/accelerator.h" |
| 21 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 22 #include "ui/views/layout/grid_layout.h" |
| 23 #include "ui/views/layout/layout_constants.h" |
| 22 #include "views/controls/button/text_button.h" | 24 #include "views/controls/button/text_button.h" |
| 23 #include "views/controls/image_view.h" | 25 #include "views/controls/image_view.h" |
| 24 #include "views/controls/label.h" | 26 #include "views/controls/label.h" |
| 25 #include "views/layout/grid_layout.h" | |
| 26 #include "views/layout/layout_constants.h" | |
| 27 #include "views/widget/widget.h" | 27 #include "views/widget/widget.h" |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 // Layout constants. | 31 // Layout constants. |
| 32 const int kInset = 2; | 32 const int kInset = 2; |
| 33 const int kImageHeadlinePadding = 4; | 33 const int kImageHeadlinePadding = 4; |
| 34 const int kHeadlineMessagePadding = 4; | 34 const int kHeadlineMessagePadding = 4; |
| 35 const int kMessageBubblePadding = 11; | 35 const int kMessageBubblePadding = 11; |
| 36 | 36 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 dismiss_button_ = new views::NativeTextButton(this, UTF16ToWide( | 193 dismiss_button_ = new views::NativeTextButton(this, UTF16ToWide( |
| 194 l10n_util::GetStringUTF16(IDS_CRITICAL_NOTIFICATION_DISMISS))); | 194 l10n_util::GetStringUTF16(IDS_CRITICAL_NOTIFICATION_DISMISS))); |
| 195 layout->AddView(dismiss_button_); | 195 layout->AddView(dismiss_button_); |
| 196 | 196 |
| 197 refresh_timer_.Start(FROM_HERE, | 197 refresh_timer_.Start(FROM_HERE, |
| 198 base::TimeDelta::FromMilliseconds(kRefreshBubbleEvery), | 198 base::TimeDelta::FromMilliseconds(kRefreshBubbleEvery), |
| 199 this, &CriticalNotificationBubbleView::OnCountdown); | 199 this, &CriticalNotificationBubbleView::OnCountdown); |
| 200 | 200 |
| 201 UserMetrics::RecordAction(UserMetricsAction("CriticalNotificationShown")); | 201 UserMetrics::RecordAction(UserMetricsAction("CriticalNotificationShown")); |
| 202 } | 202 } |
| OLD | NEW |