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

Side by Side Diff: chrome/browser/upgrade_detector.cc

Issue 2618403002: Reland crrev.com/8283cad74e0cad4840d1f with fix for static initializers. (Closed)
Patch Set: re-up Created 3 years, 11 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
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/upgrade_detector.h" 5 #include "chrome/browser/upgrade_detector.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/app/vector_icons/vector_icons.h"
9 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/lifetime/application_lifetime.h" 11 #include "chrome/browser/lifetime/application_lifetime.h"
11 #include "chrome/browser/ui/browser_otr_state.h" 12 #include "chrome/browser/ui/browser_otr_state.h"
12 #include "chrome/common/chrome_switches.h" 13 #include "chrome/common/chrome_switches.h"
13 #include "chrome/common/pref_names.h" 14 #include "chrome/common/pref_names.h"
14 #include "components/prefs/pref_registry_simple.h" 15 #include "components/prefs/pref_registry_simple.h"
15 #include "content/public/browser/notification_service.h" 16 #include "content/public/browser/notification_service.h"
16 #include "ui/gfx/color_palette.h" 17 #include "ui/gfx/color_palette.h"
17 #include "ui/gfx/paint_vector_icon.h" 18 #include "ui/gfx/paint_vector_icon.h"
18 #include "ui/gfx/vector_icons_public.h"
19 19
20 // How long to wait between checks for whether the user has been idle. 20 // How long to wait between checks for whether the user has been idle.
21 static const int kIdleRepeatingTimerWait = 10; // Minutes (seconds if testing). 21 static const int kIdleRepeatingTimerWait = 10; // Minutes (seconds if testing).
22 22
23 // How much idle time (since last input even was detected) must have passed 23 // How much idle time (since last input even was detected) must have passed
24 // until we notify that a critical update has occurred. 24 // until we notify that a critical update has occurred.
25 static const int kIdleAmount = 2; // Hours (or seconds, if testing). 25 static const int kIdleAmount = 2; // Hours (or seconds, if testing).
26 26
27 bool UseTestingIntervals() { 27 bool UseTestingIntervals() {
28 // If a command line parameter specifying how long the upgrade check should 28 // If a command line parameter specifying how long the upgrade check should
(...skipping 21 matching lines...) Expand all
50 color = gfx::kGoogleYellow700; 50 color = gfx::kGoogleYellow700;
51 break; 51 break;
52 case UPGRADE_ANNOYANCE_HIGH: 52 case UPGRADE_ANNOYANCE_HIGH:
53 case UPGRADE_ANNOYANCE_SEVERE: 53 case UPGRADE_ANNOYANCE_SEVERE:
54 case UPGRADE_ANNOYANCE_CRITICAL: 54 case UPGRADE_ANNOYANCE_CRITICAL:
55 color = gfx::kGoogleRed700; 55 color = gfx::kGoogleRed700;
56 break; 56 break;
57 } 57 }
58 DCHECK_NE(gfx::kPlaceholderColor, color); 58 DCHECK_NE(gfx::kPlaceholderColor, color);
59 59
60 return gfx::Image( 60 return gfx::Image(gfx::CreateVectorIcon(kBrowserToolsUpdateIcon, color));
61 gfx::CreateVectorIcon(gfx::VectorIconId::BROWSER_TOOLS_UPDATE, color));
62 } 61 }
63 62
64 UpgradeDetector::UpgradeDetector() 63 UpgradeDetector::UpgradeDetector()
65 : upgrade_available_(UPGRADE_AVAILABLE_NONE), 64 : upgrade_available_(UPGRADE_AVAILABLE_NONE),
66 best_effort_experiment_updates_available_(false), 65 best_effort_experiment_updates_available_(false),
67 critical_experiment_updates_available_(false), 66 critical_experiment_updates_available_(false),
68 critical_update_acknowledged_(false), 67 critical_update_acknowledged_(false),
69 is_factory_reset_required_(false), 68 is_factory_reset_required_(false),
70 upgrade_notification_stage_(UPGRADE_ANNOYANCE_NONE), 69 upgrade_notification_stage_(UPGRADE_ANNOYANCE_NONE),
71 notify_upgrade_(false) { 70 notify_upgrade_(false) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 break; 131 break;
133 case ui::IDLE_STATE_ACTIVE: 132 case ui::IDLE_STATE_ACTIVE:
134 case ui::IDLE_STATE_UNKNOWN: 133 case ui::IDLE_STATE_UNKNOWN:
135 break; 134 break;
136 default: 135 default:
137 NOTREACHED(); // Need to add any new value above (either providing 136 NOTREACHED(); // Need to add any new value above (either providing
138 // automatic restart or show notification to user). 137 // automatic restart or show notification to user).
139 break; 138 break;
140 } 139 }
141 } 140 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698