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

Side by Side Diff: chromeos/dbus/session_manager_client.cc

Issue 1162943002: Replace more ObserverList with base::ObserverList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@observer
Patch Set: Created 5 years, 6 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
« no previous file with comments | « chromeos/dbus/privet_daemon_manager_client.cc ('k') | chromeos/dbus/shill_client_helper.h » ('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) 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 "chromeos/dbus/session_manager_client.h" 5 #include "chromeos/dbus/session_manager_client.h"
6 6
7 #include <sys/socket.h> 7 #include <sys/socket.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 } 626 }
627 } 627 }
628 628
629 if (!callback.is_null()) 629 if (!callback.is_null())
630 callback.Run(state_keys); 630 callback.Run(state_keys);
631 } 631 }
632 632
633 633
634 dbus::ObjectProxy* session_manager_proxy_; 634 dbus::ObjectProxy* session_manager_proxy_;
635 scoped_ptr<BlockingMethodCaller> blocking_method_caller_; 635 scoped_ptr<BlockingMethodCaller> blocking_method_caller_;
636 ObserverList<Observer> observers_; 636 base::ObserverList<Observer> observers_;
637 637
638 // Most recent screen-lock state received from session_manager. 638 // Most recent screen-lock state received from session_manager.
639 bool screen_is_locked_; 639 bool screen_is_locked_;
640 640
641 // Note: This should remain the last member so it'll be destroyed and 641 // Note: This should remain the last member so it'll be destroyed and
642 // invalidate its weak pointers before any other members are destroyed. 642 // invalidate its weak pointers before any other members are destroyed.
643 base::WeakPtrFactory<SessionManagerClientImpl> weak_ptr_factory_; 643 base::WeakPtrFactory<SessionManagerClientImpl> weak_ptr_factory_;
644 644
645 DISALLOW_COPY_AND_ASSIGN(SessionManagerClientImpl); 645 DISALLOW_COPY_AND_ASSIGN(SessionManagerClientImpl);
646 }; 646 };
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 std::vector<std::string> state_keys; 791 std::vector<std::string> state_keys;
792 for (int i = 0; i < 5; ++i) 792 for (int i = 0; i < 5; ++i)
793 state_keys.push_back(crypto::SHA256HashString(base::IntToString(i))); 793 state_keys.push_back(crypto::SHA256HashString(base::IntToString(i)));
794 794
795 if (!callback.is_null()) 795 if (!callback.is_null())
796 callback.Run(state_keys); 796 callback.Run(state_keys);
797 } 797 }
798 798
799 private: 799 private:
800 StubDelegate* delegate_; // Weak pointer; may be NULL. 800 StubDelegate* delegate_; // Weak pointer; may be NULL.
801 ObserverList<Observer> observers_; 801 base::ObserverList<Observer> observers_;
802 std::string device_policy_; 802 std::string device_policy_;
803 bool screen_is_locked_; 803 bool screen_is_locked_;
804 804
805 DISALLOW_COPY_AND_ASSIGN(SessionManagerClientStubImpl); 805 DISALLOW_COPY_AND_ASSIGN(SessionManagerClientStubImpl);
806 }; 806 };
807 807
808 SessionManagerClient::SessionManagerClient() { 808 SessionManagerClient::SessionManagerClient() {
809 } 809 }
810 810
811 SessionManagerClient::~SessionManagerClient() { 811 SessionManagerClient::~SessionManagerClient() {
812 } 812 }
813 813
814 SessionManagerClient* SessionManagerClient::Create( 814 SessionManagerClient* SessionManagerClient::Create(
815 DBusClientImplementationType type) { 815 DBusClientImplementationType type) {
816 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 816 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
817 return new SessionManagerClientImpl(); 817 return new SessionManagerClientImpl();
818 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 818 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
819 return new SessionManagerClientStubImpl(); 819 return new SessionManagerClientStubImpl();
820 } 820 }
821 821
822 } // namespace chromeos 822 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/privet_daemon_manager_client.cc ('k') | chromeos/dbus/shill_client_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698