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

Side by Side Diff: chrome/browser/ui/network_profile_bubble.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/network_profile_bubble.h ('k') | chrome/browser/ui/prefs/prefs_tab_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 ::WTSFreeMemory(buffer); 149 ::WTSFreeMemory(buffer);
150 } 150 }
151 151
152 // static 152 // static
153 void NetworkProfileBubble::SetNotificationShown(bool shown) { 153 void NetworkProfileBubble::SetNotificationShown(bool shown) {
154 notification_shown_ = shown; 154 notification_shown_ = shown;
155 } 155 }
156 156
157 // static 157 // static
158 void NetworkProfileBubble::RegisterPrefs(PrefService* prefs) { 158 void NetworkProfileBubble::RegisterUserPrefs(PrefServiceSyncable* prefs) {
159 prefs->RegisterIntegerPref(prefs::kNetworkProfileWarningsLeft, 159 prefs->RegisterIntegerPref(prefs::kNetworkProfileWarningsLeft, kMaxWarnings,
160 kMaxWarnings, 160 PrefServiceSyncable::UNSYNCABLE_PREF);
161 PrefService::UNSYNCABLE_PREF); 161 prefs->RegisterInt64Pref(prefs::kNetworkProfileLastWarningTime, 0,
162 prefs->RegisterInt64Pref(prefs::kNetworkProfileLastWarningTime, 162 PrefServiceSyncable::UNSYNCABLE_PREF);
163 0,
164 PrefService::UNSYNCABLE_PREF);
165 } 163 }
166 164
167 // static 165 // static
168 void NetworkProfileBubble::RecordUmaEvent(MetricNetworkedProfileCheck event) { 166 void NetworkProfileBubble::RecordUmaEvent(MetricNetworkedProfileCheck event) {
169 UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck, 167 UMA_HISTOGRAM_ENUMERATION(kMetricNetworkedProfileCheck,
170 event, 168 event,
171 METRIC_NETWORKED_PROFILE_CHECK_SIZE); 169 METRIC_NETWORKED_PROFILE_CHECK_SIZE);
172 } 170 }
173 171
174 // static 172 // static
175 void NetworkProfileBubble::NotifyNetworkProfileDetected() { 173 void NetworkProfileBubble::NotifyNetworkProfileDetected() {
176 // TODO(robertshield): Eventually, we will need to figure out the correct 174 // TODO(robertshield): Eventually, we will need to figure out the correct
177 // desktop type for this for platforms that can have 175 // desktop type for this for platforms that can have
178 // multiple desktop types (win8/metro). 176 // multiple desktop types (win8/metro).
179 Browser* browser = chrome::FindLastActiveWithHostDesktopType( 177 Browser* browser = chrome::FindLastActiveWithHostDesktopType(
180 chrome::HOST_DESKTOP_TYPE_NATIVE); 178 chrome::HOST_DESKTOP_TYPE_NATIVE);
181 179
182 if (browser) 180 if (browser)
183 ShowNotification(browser); 181 ShowNotification(browser);
184 else 182 else
185 BrowserList::AddObserver(new BrowserListObserver()); 183 BrowserList::AddObserver(new BrowserListObserver());
186 } 184 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/network_profile_bubble.h ('k') | chrome/browser/ui/prefs/prefs_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698