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

Side by Side Diff: chrome/browser/sync/notifier/base/network_status_detector_task.cc

Issue 1956001: Moved XMPP notifier library from chrome/browser/sync to chrome/common.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/sync/notifier/base/network_status_detector_task.h"
6
7 namespace notifier {
8
9 void NetworkStatusDetectorTask::DetectNetworkState() {
10 // If the detection has been finished, then just broadcast the current state.
11 // Otherwise, allow the signal to be sent when the initial detection is
12 // finished.
13 if (initial_detection_done_) {
14 SignalNetworkStateDetected(is_alive_, is_alive_);
15 }
16 }
17
18 void NetworkStatusDetectorTask::SetNetworkAlive(bool is_alive) {
19 bool was_alive = is_alive_;
20 is_alive_ = is_alive;
21
22 if (!initial_detection_done_ || was_alive != is_alive_) {
23 initial_detection_done_ = true;
24
25 // Tell everyone about the network state change.
26 SignalNetworkStateDetected(was_alive, is_alive_);
27 }
28 }
29
30 } // namespace notifier
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698