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

Side by Side Diff: chrome/browser/automation/automation_provider_observers_chromeos.cc

Issue 8588006: Eliminate CrosLibrary::EnsureLoaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 1 month 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 | « no previous file | chrome/browser/automation/testing_automation_provider_chromeos.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/automation/automation_provider_observers.h" 5 #include "chrome/browser/automation/automation_provider_observers.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/automation/automation_provider.h" 8 #include "chrome/browser/automation/automation_provider.h"
9 #include "chrome/browser/chromeos/cros/cros_library.h" 9 #include "chrome/browser/chromeos/cros/cros_library.h"
10 #include "chrome/browser/chromeos/login/authentication_notification_details.h" 10 #include "chrome/browser/chromeos/login/authentication_notification_details.h"
(...skipping 10 matching lines...) Expand all
21 21
22 NetworkManagerInitObserver::NetworkManagerInitObserver( 22 NetworkManagerInitObserver::NetworkManagerInitObserver(
23 AutomationProvider* automation) 23 AutomationProvider* automation)
24 : automation_(automation->AsWeakPtr()) {} 24 : automation_(automation->AsWeakPtr()) {}
25 25
26 NetworkManagerInitObserver::~NetworkManagerInitObserver() { 26 NetworkManagerInitObserver::~NetworkManagerInitObserver() {
27 CrosLibrary::Get()->GetNetworkLibrary()->RemoveNetworkManagerObserver(this); 27 CrosLibrary::Get()->GetNetworkLibrary()->RemoveNetworkManagerObserver(this);
28 } 28 }
29 29
30 bool NetworkManagerInitObserver::Init() { 30 bool NetworkManagerInitObserver::Init() {
31 if (!CrosLibrary::Get()->EnsureLoaded()) { 31 if (!CrosLibrary::Get()->libcros_loaded()) {
32 // If cros library fails to load, don't wait for the network 32 // If cros library fails to load, don't wait for the network
33 // library to finish initializing, because it'll wait forever. 33 // library to finish initializing, because it'll wait forever.
34 automation_->OnNetworkLibraryInit(); 34 automation_->OnNetworkLibraryInit();
35 return false; 35 return false;
36 } 36 }
37 37
38 CrosLibrary::Get()->GetNetworkLibrary()->AddNetworkManagerObserver(this); 38 CrosLibrary::Get()->GetNetworkLibrary()->AddNetworkManagerObserver(this);
39 return true; 39 return true;
40 } 40 }
41 41
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 user_manager->AddObserver(this); 476 user_manager->AddObserver(this);
477 user_manager->SaveUserImage(user.email(), photo); 477 user_manager->SaveUserImage(user.email(), photo);
478 } 478 }
479 479
480 void PhotoCaptureObserver::LocalStateChanged( 480 void PhotoCaptureObserver::LocalStateChanged(
481 chromeos::UserManager* user_manager) { 481 chromeos::UserManager* user_manager) {
482 user_manager->RemoveObserver(this); 482 user_manager->RemoveObserver(this);
483 AutomationJSONReply(automation_, reply_message_.release()).SendSuccess(NULL); 483 AutomationJSONReply(automation_, reply_message_.release()).SendSuccess(NULL);
484 delete this; 484 delete this;
485 } 485 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698