| OLD | NEW |
| 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/chromeos/login/update_screen.h" | 5 #include "chrome/browser/chromeos/login/update_screen.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 screen->SetIgnoreIdleStatus(false); | 50 screen->SetIgnoreIdleStatus(false); |
| 51 else | 51 else |
| 52 screen->ExitUpdate(UpdateScreen::REASON_UPDATE_INIT_FAILED); | 52 screen->ExitUpdate(UpdateScreen::REASON_UPDATE_INIT_FAILED); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // anonymous namespace | 56 } // anonymous namespace |
| 57 | 57 |
| 58 // static | 58 // static |
| 59 UpdateScreen::InstanceSet& UpdateScreen::GetInstanceSet() { | 59 UpdateScreen::InstanceSet& UpdateScreen::GetInstanceSet() { |
| 60 static std::set<UpdateScreen*> instance_set; | 60 CR_DEFINE_STATIC_LOCAL(std::set<UpdateScreen*>, instance_set, ()); |
| 61 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // not threadsafe. | 61 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // not threadsafe. |
| 62 return instance_set; | 62 return instance_set; |
| 63 } | 63 } |
| 64 | 64 |
| 65 // static | 65 // static |
| 66 bool UpdateScreen::HasInstance(UpdateScreen* inst) { | 66 bool UpdateScreen::HasInstance(UpdateScreen* inst) { |
| 67 InstanceSet& instance_set = GetInstanceSet(); | 67 InstanceSet& instance_set = GetInstanceSet(); |
| 68 InstanceSet::iterator found = instance_set.find(inst); | 68 InstanceSet::iterator found = instance_set.find(inst); |
| 69 return (found != instance_set.end()); | 69 return (found != instance_set.end()); |
| 70 } | 70 } |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 // if the file exists and not empty, there is critical update. | 293 // if the file exists and not empty, there is critical update. |
| 294 return true; | 294 return true; |
| 295 } | 295 } |
| 296 | 296 |
| 297 void UpdateScreen::OnActorDestroyed(UpdateScreenActor* actor) { | 297 void UpdateScreen::OnActorDestroyed(UpdateScreenActor* actor) { |
| 298 if (actor_ == actor) | 298 if (actor_ == actor) |
| 299 actor_ = NULL; | 299 actor_ = NULL; |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace chromeos | 302 } // namespace chromeos |
| OLD | NEW |