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

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

Issue 10382197: Add PyAuto test for DeviceGuestModeEnabled policy (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Comments addressed. Created 8 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
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/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 30 matching lines...) Expand all
41 } 41 }
42 42
43 void NetworkManagerInitObserver::OnNetworkManagerChanged(NetworkLibrary* obj) { 43 void NetworkManagerInitObserver::OnNetworkManagerChanged(NetworkLibrary* obj) {
44 if (!obj->wifi_scanning()) { 44 if (!obj->wifi_scanning()) {
45 if (automation_) 45 if (automation_)
46 automation_->OnNetworkLibraryInit(); 46 automation_->OnNetworkLibraryInit();
47 delete this; 47 delete this;
48 } 48 }
49 } 49 }
50 50
51 LoginWebuiReadyObserver::LoginWebuiReadyObserver( 51 LoginWebuiReadyObserver::LoginWebuiReadyObserver(AutomationProvider* automation)
52 AutomationProvider* automation)
53 : automation_(automation->AsWeakPtr()) { 52 : automation_(automation->AsWeakPtr()) {
54 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_READY, 53 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_READY,
55 content::NotificationService::AllSources()); 54 content::NotificationService::AllSources());
56 } 55 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_IMAGES_LOADED,
57 56 content::NotificationService::AllSources());
58 LoginWebuiReadyObserver::~LoginWebuiReadyObserver() { 57 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN,
Nirnimesh 2012/05/16 19:48:26 When is this raised? It takes a while for the logi
Nikita (slow) 2012/05/22 11:09:16 Yes, it is that one. So in that case you'll see NO
58 content::NotificationService::AllSources());
59 registrar_.Add(this, chrome::NOTIFICATION_WIZARD_FIRST_SCREEN_SHOWN,
60 content::NotificationService::AllSources());
59 } 61 }
60 62
61 void LoginWebuiReadyObserver::Observe( 63 void LoginWebuiReadyObserver::Observe(
62 int type, 64 int type,
63 const content::NotificationSource& source, 65 const content::NotificationSource& source,
64 const content::NotificationDetails& details) { 66 const content::NotificationDetails& details) {
65 DCHECK(type == chrome::NOTIFICATION_LOGIN_WEBUI_READY); 67 DCHECK(type == chrome::NOTIFICATION_LOGIN_WEBUI_READY ||
68 type == chrome::NOTIFICATION_LOGIN_USER_IMAGES_LOADED ||
69 type == chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN ||
70 type == chrome::NOTIFICATION_WIZARD_FIRST_SCREEN_SHOWN);
66 if (automation_) 71 if (automation_)
67 automation_->OnLoginWebuiReady(); 72 automation_->OnLoginWebuiReady();
68 delete this; 73 delete this;
69 } 74 }
70 75
71 LoginObserver::LoginObserver(chromeos::ExistingUserController* controller, 76 LoginObserver::LoginObserver(chromeos::ExistingUserController* controller,
72 AutomationProvider* automation, 77 AutomationProvider* automation,
73 IPC::Message* reply_message) 78 IPC::Message* reply_message)
74 : controller_(controller), 79 : controller_(controller),
75 automation_(automation->AsWeakPtr()), 80 automation_(automation->AsWeakPtr()),
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 458
454 void PhotoCaptureObserver::LocalStateChanged( 459 void PhotoCaptureObserver::LocalStateChanged(
455 chromeos::UserManager* user_manager) { 460 chromeos::UserManager* user_manager) {
456 user_manager->RemoveObserver(this); 461 user_manager->RemoveObserver(this);
457 if (automation_) { 462 if (automation_) {
458 AutomationJSONReply( 463 AutomationJSONReply(
459 automation_, reply_message_.release()).SendSuccess(NULL); 464 automation_, reply_message_.release()).SendSuccess(NULL);
460 } 465 }
461 delete this; 466 delete this;
462 } 467 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider_observers.h ('k') | chrome/test/functional/PYAUTO_TESTS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698