Commit 126415df authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Remove using directives ("using namespace x") from chrome/browser/extensions/.

Bug: 82078
Change-Id: Ic2152a5bc8464df9354dcd158a72d6f5168d6030
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1844338
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703387}
parent 9560b7ed
...@@ -552,7 +552,6 @@ bool CommandService::CanAutoAssign(const Command &command, ...@@ -552,7 +552,6 @@ bool CommandService::CanAutoAssign(const Command &command,
return true; return true;
if (command.global()) { if (command.global()) {
using namespace extensions;
if (command.command_name() == manifest_values::kBrowserActionCommandEvent || if (command.command_name() == manifest_values::kBrowserActionCommandEvent ||
command.command_name() == manifest_values::kPageActionCommandEvent) command.command_name() == manifest_values::kPageActionCommandEvent)
return false; // Browser and page actions are not global in nature. return false; // Browser and page actions are not global in nature.
......
...@@ -23,14 +23,10 @@ ...@@ -23,14 +23,10 @@
#include "extensions/browser/extension_function_dispatcher.h" #include "extensions/browser/extension_function_dispatcher.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
using crypto::SHA256HashString;
namespace extensions { namespace extensions {
namespace { namespace {
using namespace api::cryptotoken_private;
bool GetSingleBooleanResult(ExtensionFunction* function, bool* result) { bool GetSingleBooleanResult(ExtensionFunction* function, bool* result) {
const base::ListValue* result_list = function->GetResultList(); const base::ListValue* result_list = function->GetResultList();
if (!result_list) { if (!result_list) {
...@@ -133,9 +129,9 @@ TEST_F(CryptoTokenPrivateApiTest, CanOriginAssertAppId) { ...@@ -133,9 +129,9 @@ TEST_F(CryptoTokenPrivateApiTest, CanOriginAssertAppId) {
TEST_F(CryptoTokenPrivateApiTest, IsAppIdHashInEnterpriseContext) { TEST_F(CryptoTokenPrivateApiTest, IsAppIdHashInEnterpriseContext) {
const std::string example_com("https://example.com/"); const std::string example_com("https://example.com/");
const std::string example_com_hash(SHA256HashString(example_com)); const std::string example_com_hash(crypto::SHA256HashString(example_com));
const std::string rp_id_hash(SHA256HashString("example.com")); const std::string rp_id_hash(crypto::SHA256HashString("example.com"));
const std::string foo_com_hash(SHA256HashString("https://foo.com/")); const std::string foo_com_hash(crypto::SHA256HashString("https://foo.com/"));
bool result; bool result;
ASSERT_TRUE(GetAppIdHashInEnterpriseContext(example_com_hash, &result)); ASSERT_TRUE(GetAppIdHashInEnterpriseContext(example_com_hash, &result));
......
...@@ -15,9 +15,6 @@ namespace extensions { ...@@ -15,9 +15,6 @@ namespace extensions {
namespace { namespace {
using namespace chromeos::disks;
using namespace api::image_writer_private;
const char kDevicePathUSB[] = "/dev/test-usb"; const char kDevicePathUSB[] = "/dev/test-usb";
const char kDevicePathSD[] = "/dev/test-sd"; const char kDevicePathSD[] = "/dev/test-sd";
const char kMountPath[] = "/test-mount"; const char kMountPath[] = "/test-mount";
...@@ -36,12 +33,13 @@ class RemovableStorageProviderChromeOsUnitTest : public testing::Test { ...@@ -36,12 +33,13 @@ class RemovableStorageProviderChromeOsUnitTest : public testing::Test {
public: public:
RemovableStorageProviderChromeOsUnitTest() {} RemovableStorageProviderChromeOsUnitTest() {}
void SetUp() override { void SetUp() override {
disk_mount_manager_mock_ = new MockDiskMountManager(); disk_mount_manager_mock_ = new chromeos::disks::MockDiskMountManager();
DiskMountManager::InitializeForTesting(disk_mount_manager_mock_); chromeos::disks::DiskMountManager::InitializeForTesting(
disk_mount_manager_mock_);
disk_mount_manager_mock_->SetupDefaultReplies(); disk_mount_manager_mock_->SetupDefaultReplies();
} }
void TearDown() override { DiskMountManager::Shutdown(); } void TearDown() override { chromeos::disks::DiskMountManager::Shutdown(); }
void DevicesCallback(scoped_refptr<StorageDeviceList> devices) { void DevicesCallback(scoped_refptr<StorageDeviceList> devices) {
devices_ = devices; devices_ = devices;
...@@ -68,10 +66,8 @@ class RemovableStorageProviderChromeOsUnitTest : public testing::Test { ...@@ -68,10 +66,8 @@ class RemovableStorageProviderChromeOsUnitTest : public testing::Test {
bool is_parent, bool is_parent,
bool has_media, bool has_media,
bool on_boot_device) { bool on_boot_device) {
DiskMountManager::MountPointInfo mount_info( chromeos::disks::DiskMountManager::MountPointInfo mount_info(
device_path, device_path, kMountPath, chromeos::MOUNT_TYPE_DEVICE,
kMountPath,
chromeos::MOUNT_TYPE_DEVICE,
chromeos::disks::MOUNT_CONDITION_NONE); chromeos::disks::MOUNT_CONDITION_NONE);
disk_mount_manager_mock_->CreateDiskEntryForMountDevice( disk_mount_manager_mock_->CreateDiskEntryForMountDevice(
mount_info, kDeviceId, kDeviceName, vendor_name, product_name, mount_info, kDeviceId, kDeviceName, vendor_name, product_name,
...@@ -80,13 +76,14 @@ class RemovableStorageProviderChromeOsUnitTest : public testing::Test { ...@@ -80,13 +76,14 @@ class RemovableStorageProviderChromeOsUnitTest : public testing::Test {
} }
// Checks if the DeviceList has a specific entry. // Checks if the DeviceList has a specific entry.
RemovableStorageDevice* FindDevice(StorageDeviceList* list, api::image_writer_private::RemovableStorageDevice* FindDevice(
const std::string& file_path) { StorageDeviceList* list,
for (RemovableStorageDevice& device : list->data) { const std::string& file_path) {
for (auto& device : list->data) {
if (device.storage_unit_id == file_path) if (device.storage_unit_id == file_path)
return &device; return &device;
} }
return NULL; return nullptr;
} }
void ExpectDevice(StorageDeviceList* list, void ExpectDevice(StorageDeviceList* list,
...@@ -94,9 +91,9 @@ class RemovableStorageProviderChromeOsUnitTest : public testing::Test { ...@@ -94,9 +91,9 @@ class RemovableStorageProviderChromeOsUnitTest : public testing::Test {
const std::string& vendor, const std::string& vendor,
const std::string& model, const std::string& model,
uint64_t capacity) { uint64_t capacity) {
RemovableStorageDevice* device = FindDevice(devices_.get(), device_path); auto* device = FindDevice(devices_.get(), device_path);
ASSERT_TRUE(device != NULL); ASSERT_TRUE(device);
EXPECT_EQ(device_path, device->storage_unit_id); EXPECT_EQ(device_path, device->storage_unit_id);
EXPECT_EQ(vendor, device->vendor); EXPECT_EQ(vendor, device->vendor);
...@@ -105,7 +102,7 @@ class RemovableStorageProviderChromeOsUnitTest : public testing::Test { ...@@ -105,7 +102,7 @@ class RemovableStorageProviderChromeOsUnitTest : public testing::Test {
} }
content::BrowserTaskEnvironment task_environment_; content::BrowserTaskEnvironment task_environment_;
MockDiskMountManager* disk_mount_manager_mock_; chromeos::disks::MockDiskMountManager* disk_mount_manager_mock_;
scoped_refptr<StorageDeviceList> devices_; scoped_refptr<StorageDeviceList> devices_;
}; };
......
...@@ -44,16 +44,10 @@ ...@@ -44,16 +44,10 @@
#include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/scoped_user_manager.h"
#endif #endif
using ::testing::NotNull;
using ::testing::Return;
using ::testing::_;
namespace extensions { namespace extensions {
namespace { namespace {
using namespace net::test_server;
const char kManifestPath[] = "/update_manifest"; const char kManifestPath[] = "/update_manifest";
const char kAppPath[] = "/app.crx"; const char kAppPath[] = "/app.crx";
...@@ -99,7 +93,7 @@ class ExternalProviderImplTest : public ExtensionServiceTestBase { ...@@ -99,7 +93,7 @@ class ExternalProviderImplTest : public ExtensionServiceTestBase {
// ExtensionServiceTestBase overrides: // ExtensionServiceTestBase overrides:
void SetUp() override { void SetUp() override {
ExtensionServiceTestBase::SetUp(); ExtensionServiceTestBase::SetUp();
test_server_.reset(new EmbeddedTestServer()); test_server_ = std::make_unique<net::test_server::EmbeddedTestServer>();
test_server_->RegisterRequestHandler( test_server_->RegisterRequestHandler(
base::Bind(&ExternalProviderImplTest::HandleRequest, base::Bind(&ExternalProviderImplTest::HandleRequest,
...@@ -113,10 +107,11 @@ class ExternalProviderImplTest : public ExtensionServiceTestBase { ...@@ -113,10 +107,11 @@ class ExternalProviderImplTest : public ExtensionServiceTestBase {
} }
private: private:
std::unique_ptr<HttpResponse> HandleRequest(const HttpRequest& request) { std::unique_ptr<net::test_server::HttpResponse> HandleRequest(
const net::test_server::HttpRequest& request) {
GURL url = test_server_->GetURL(request.relative_url); GURL url = test_server_->GetURL(request.relative_url);
if (url.path() == kManifestPath) { if (url.path() == kManifestPath) {
std::unique_ptr<BasicHttpResponse> response(new BasicHttpResponse); auto response = std::make_unique<net::test_server::BasicHttpResponse>();
response->set_code(net::HTTP_OK); response->set_code(net::HTTP_OK);
response->set_content(base::StringPrintf( response->set_content(base::StringPrintf(
"<?xml version='1.0' encoding='UTF-8'?>\n" "<?xml version='1.0' encoding='UTF-8'?>\n"
...@@ -138,7 +133,7 @@ class ExternalProviderImplTest : public ExtensionServiceTestBase { ...@@ -138,7 +133,7 @@ class ExternalProviderImplTest : public ExtensionServiceTestBase {
base::ReadFileToString( base::ReadFileToString(
test_data_dir.AppendASCII("extensions/dummyiap.crx"), test_data_dir.AppendASCII("extensions/dummyiap.crx"),
&contents); &contents);
std::unique_ptr<BasicHttpResponse> response(new BasicHttpResponse); auto response = std::make_unique<net::test_server::BasicHttpResponse>();
response->set_code(net::HTTP_OK); response->set_code(net::HTTP_OK);
response->set_content(contents); response->set_content(contents);
return std::move(response); return std::move(response);
...@@ -147,7 +142,7 @@ class ExternalProviderImplTest : public ExtensionServiceTestBase { ...@@ -147,7 +142,7 @@ class ExternalProviderImplTest : public ExtensionServiceTestBase {
return nullptr; return nullptr;
} }
std::unique_ptr<EmbeddedTestServer> test_server_; std::unique_ptr<net::test_server::EmbeddedTestServer> test_server_;
std::unique_ptr<ExtensionCacheFake> test_extension_cache_; std::unique_ptr<ExtensionCacheFake> test_extension_cache_;
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
......
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