Commit 1eecf420 authored by Kushagra Sinha's avatar Kushagra Sinha Committed by Commit Bot

crOS Account Manager: Remove usages of DISALLOW_COPY_AND_ASSIGN

Change-Id: Ia9a8794d62e11ca294583c524a9f6256ee7b048a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2256218
Commit-Queue: Kush Sinha <sinhak@chromium.org>
Reviewed-by: default avatarAnastasiia N <anastasiian@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781789}
parent 6cf5b9cf
......@@ -94,7 +94,9 @@ class AccountManager::GaiaTokenRevocationRequest : public GaiaAuthConsumer {
&GaiaTokenRevocationRequest::Start, weak_factory_.GetWeakPtr());
delay_network_call_runner.Run(std::move(start_revoke_token));
}
GaiaTokenRevocationRequest(const GaiaTokenRevocationRequest&) = delete;
GaiaTokenRevocationRequest& operator=(const GaiaTokenRevocationRequest&) =
delete;
~GaiaTokenRevocationRequest() override = default;
// GaiaAuthConsumer overrides.
......@@ -125,7 +127,6 @@ class AccountManager::GaiaTokenRevocationRequest : public GaiaAuthConsumer {
std::string refresh_token_;
base::WeakPtrFactory<GaiaTokenRevocationRequest> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(GaiaTokenRevocationRequest);
};
bool AccountManager::AccountKey::IsValid() const {
......
......@@ -16,7 +16,6 @@
#include "base/component_export.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/sequence_checker.h"
......@@ -93,6 +92,8 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManager {
class Observer {
public:
Observer();
Observer(const Observer&) = delete;
Observer& operator=(const Observer&) = delete;
virtual ~Observer();
// Called when the token for |account| is updated/inserted.
......@@ -110,13 +111,12 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManager {
// |AccountManager::CreateAccessTokenFetcher|), must clear their cache entry
// for this |account| on receiving this callback.
virtual void OnAccountRemoved(const Account& account) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(Observer);
};
// Note: |Initialize| MUST be called at least once on this object.
AccountManager();
AccountManager(const AccountManager&) = delete;
AccountManager& operator=(const AccountManager&) = delete;
virtual ~AccountManager();
static void RegisterPrefs(PrefRegistrySimple* registry);
......@@ -400,7 +400,6 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManager {
SEQUENCE_CHECKER(sequence_checker_);
base::WeakPtrFactory<AccountManager> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(AccountManager);
};
// For logging.
......
......@@ -10,7 +10,6 @@
#include <unordered_map>
#include "base/component_export.h"
#include "base/macros.h"
#include "base/sequence_checker.h"
#include "chromeos/components/account_manager/account_manager.h"
......@@ -28,6 +27,8 @@ namespace chromeos {
class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManagerFactory {
public:
AccountManagerFactory();
AccountManagerFactory(const AccountManagerFactory&) = delete;
AccountManagerFactory& operator=(const AccountManagerFactory&) = delete;
~AccountManagerFactory();
// Returns the |AccountManager| corresponding to the given |profile_path|.
......@@ -40,8 +41,6 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER) AccountManagerFactory {
account_managers_;
SEQUENCE_CHECKER(sequence_checker_);
DISALLOW_COPY_AND_ASSIGN(AccountManagerFactory);
};
} // namespace chromeos
......
......@@ -13,7 +13,6 @@
#include "base/bind_helpers.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
......@@ -56,17 +55,18 @@ bool IsAccountKeyPresent(const std::vector<AccountManager::Account>& accounts,
class AccountManagerSpy : public AccountManager {
public:
AccountManagerSpy() = default;
AccountManagerSpy(const AccountManagerSpy&) = delete;
AccountManagerSpy& operator=(const AccountManagerSpy&) = delete;
~AccountManagerSpy() override = default;
MOCK_METHOD(void, RevokeGaiaTokenOnServer, (const std::string&));
private:
DISALLOW_COPY_AND_ASSIGN(AccountManagerSpy);
};
class AccountManagerTest : public testing::Test {
public:
AccountManagerTest() = default;
AccountManagerTest(const AccountManagerTest&) = delete;
AccountManagerTest& operator=(const AccountManagerTest&) = delete;
~AccountManagerTest() override = default;
protected:
......@@ -185,13 +185,13 @@ class AccountManagerTest : public testing::Test {
TestingPrefServiceSimple pref_service_;
network::TestURLLoaderFactory test_url_loader_factory_;
std::unique_ptr<AccountManagerSpy> account_manager_;
DISALLOW_COPY_AND_ASSIGN(AccountManagerTest);
};
class AccountManagerObserver : public AccountManager::Observer {
public:
AccountManagerObserver() = default;
AccountManagerObserver(const AccountManagerObserver&) = delete;
AccountManagerObserver& operator=(const AccountManagerObserver&) = delete;
~AccountManagerObserver() override = default;
void OnTokenUpserted(const AccountManager::Account& account) override {
......@@ -254,8 +254,6 @@ class AccountManagerObserver : public AccountManager::Observer {
AccountManager::AccountKey last_removed_account_key_;
std::string last_removed_account_email_;
std::set<AccountManager::AccountKey> accounts_;
DISALLOW_COPY_AND_ASSIGN(AccountManagerObserver);
};
TEST(AccountManagerKeyTest, TestValidity) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment