| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::RegisterProfilePrefs( | 160 void NetworkProfileBubble::RegisterProfilePrefs( |
| 161 user_prefs::PrefRegistrySyncable* registry) { | 161 user_prefs::PrefRegistrySyncable* registry) { |
| 162 registry->RegisterIntegerPref( | 162 registry->RegisterIntegerPref(prefs::kNetworkProfileWarningsLeft, |
| 163 prefs::kNetworkProfileWarningsLeft, | 163 kMaxWarnings); |
| 164 kMaxWarnings, | 164 registry->RegisterInt64Pref(prefs::kNetworkProfileLastWarningTime, 0); |
| 165 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 166 registry->RegisterInt64Pref( | |
| 167 prefs::kNetworkProfileLastWarningTime, | |
| 168 0, | |
| 169 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 170 } | 165 } |
| 171 | 166 |
| 172 // static | 167 // static |
| 173 void NetworkProfileBubble::RecordUmaEvent(MetricNetworkedProfileCheck event) { | 168 void NetworkProfileBubble::RecordUmaEvent(MetricNetworkedProfileCheck event) { |
| 174 UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck, | 169 UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck, |
| 175 event, | 170 event, |
| 176 METRIC_NETWORKED_PROFILE_CHECK_SIZE); | 171 METRIC_NETWORKED_PROFILE_CHECK_SIZE); |
| 177 } | 172 } |
| 178 | 173 |
| 179 // static | 174 // static |
| 180 void NetworkProfileBubble::NotifyNetworkProfileDetected() { | 175 void NetworkProfileBubble::NotifyNetworkProfileDetected() { |
| 181 Browser* browser = chrome::FindLastActiveWithHostDesktopType( | 176 Browser* browser = chrome::FindLastActiveWithHostDesktopType( |
| 182 chrome::GetActiveDesktop()); | 177 chrome::GetActiveDesktop()); |
| 183 | 178 |
| 184 if (browser) | 179 if (browser) |
| 185 ShowNotification(browser); | 180 ShowNotification(browser); |
| 186 else | 181 else |
| 187 BrowserList::AddObserver(new BrowserListObserver()); | 182 BrowserList::AddObserver(new BrowserListObserver()); |
| 188 } | 183 } |
| OLD | NEW |