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

Side by Side Diff: chrome/browser/net/predictor_api.cc

Issue 7639002: Profiles: BROWSER_OPENED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Same code; another round to see if flake Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/metrics/metrics_service.cc ('k') | chrome/browser/sessions/session_service.cc » ('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) 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/net/predictor_api.h" 5 #include "chrome/browser/net/predictor_api.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 // This object lives on the UI thread. 301 // This object lives on the UI thread.
302 302
303 class OffTheRecordObserver : public NotificationObserver { 303 class OffTheRecordObserver : public NotificationObserver {
304 public: 304 public:
305 void Register() { 305 void Register() {
306 // TODO(pkasting): This test should not be necessary. See crbug.com/12475. 306 // TODO(pkasting): This test should not be necessary. See crbug.com/12475.
307 if (registrar_.IsEmpty()) { 307 if (registrar_.IsEmpty()) {
308 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, 308 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED,
309 NotificationService::AllSources()); 309 NotificationService::AllSources());
310 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED, 310 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED,
311 NotificationService::AllSources()); 311 NotificationService::AllBrowserContextsAndSources());
312 } 312 }
313 } 313 }
314 314
315 void Observe(int type, const NotificationSource& source, 315 void Observe(int type, const NotificationSource& source,
316 const NotificationDetails& details) { 316 const NotificationDetails& details) {
317 switch (type) { 317 switch (type) {
318 case chrome::NOTIFICATION_BROWSER_OPENED: 318 case chrome::NOTIFICATION_BROWSER_OPENED:
319 if (!Source<Browser>(source)->profile()->IsOffTheRecord()) 319 if (!Source<Browser>(source)->profile()->IsOffTheRecord())
320 break; 320 break;
321 ++count_off_the_record_windows_; 321 ++count_off_the_record_windows_;
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 DCHECK(!g_predictor); 641 DCHECK(!g_predictor);
642 InitNetworkPredictor(max_queueing_delay, max_parallel_resolves, user_prefs, 642 InitNetworkPredictor(max_queueing_delay, max_parallel_resolves, user_prefs,
643 local_state, preconnect_enabled); 643 local_state, preconnect_enabled);
644 } 644 }
645 } 645 }
646 646
647 PredictorInit::~PredictorInit() { 647 PredictorInit::~PredictorInit() {
648 } 648 }
649 649
650 } // namespace chrome_browser_net 650 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_service.cc ('k') | chrome/browser/sessions/session_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698