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/network_profile_bubble.h" | 5 #include "chrome/browser/ui/network_profile_bubble.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <wtsapi32.h> | 9 #include <wtsapi32.h> |
10 // Make sure we link the wtsapi lib file in. | 10 // Make sure we link the wtsapi lib file in. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 ::WTSFreeMemory(buffer); | 151 ::WTSFreeMemory(buffer); |
152 } | 152 } |
153 | 153 |
154 // static | 154 // static |
155 void NetworkProfileBubble::SetNotificationShown(bool shown) { | 155 void NetworkProfileBubble::SetNotificationShown(bool shown) { |
156 notification_shown_ = shown; | 156 notification_shown_ = shown; |
157 } | 157 } |
158 | 158 |
159 // static | 159 // static |
160 void NetworkProfileBubble::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 160 void NetworkProfileBubble::RegisterUserPrefs( |
161 registry->RegisterIntegerPref(prefs::kNetworkProfileWarningsLeft, | 161 user_prefs::PrefRegistrySyncable* registry) { |
162 kMaxWarnings, | 162 registry->RegisterIntegerPref( |
163 PrefRegistrySyncable::UNSYNCABLE_PREF); | 163 prefs::kNetworkProfileWarningsLeft, |
164 registry->RegisterInt64Pref(prefs::kNetworkProfileLastWarningTime, | 164 kMaxWarnings, |
165 0, | 165 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
166 PrefRegistrySyncable::UNSYNCABLE_PREF); | 166 registry->RegisterInt64Pref( |
| 167 prefs::kNetworkProfileLastWarningTime, |
| 168 0, |
| 169 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
167 } | 170 } |
168 | 171 |
169 // static | 172 // static |
170 void NetworkProfileBubble::RecordUmaEvent(MetricNetworkedProfileCheck event) { | 173 void NetworkProfileBubble::RecordUmaEvent(MetricNetworkedProfileCheck event) { |
171 UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck, | 174 UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck, |
172 event, | 175 event, |
173 METRIC_NETWORKED_PROFILE_CHECK_SIZE); | 176 METRIC_NETWORKED_PROFILE_CHECK_SIZE); |
174 } | 177 } |
175 | 178 |
176 // static | 179 // static |
177 void NetworkProfileBubble::NotifyNetworkProfileDetected() { | 180 void NetworkProfileBubble::NotifyNetworkProfileDetected() { |
178 Browser* browser = chrome::FindLastActiveWithHostDesktopType( | 181 Browser* browser = chrome::FindLastActiveWithHostDesktopType( |
179 chrome::GetActiveDesktop()); | 182 chrome::GetActiveDesktop()); |
180 | 183 |
181 if (browser) | 184 if (browser) |
182 ShowNotification(browser); | 185 ShowNotification(browser); |
183 else | 186 else |
184 BrowserList::AddObserver(new BrowserListObserver()); | 187 BrowserList::AddObserver(new BrowserListObserver()); |
185 } | 188 } |
OLD | NEW |