diff options
author | jamescook <jamescook@chromium.org> | 2015-02-17 15:19:52 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-17 23:20:41 +0000 |
commit | 4dec2928f6227fa8ec9b3381deeb15c15d6ab320 (patch) | |
tree | 996e53942cd68c5c8371157806a33c5389bfd472 /extensions | |
parent | a8a9e2cd46440abd315cc876a8f6740ded878a0b (diff) | |
download | chromium_src-4dec2928f6227fa8ec9b3381deeb15c15d6ab320.zip chromium_src-4dec2928f6227fa8ec9b3381deeb15c15d6ab320.tar.gz chromium_src-4dec2928f6227fa8ec9b3381deeb15c15d6ab320.tar.bz2 |
cros: Remove shell.gcd app_shell API and D-Bus wrapper for privetd
Nothing uses this API and the API is the only user of the privetd bindings.
BUG=458724
TEST=compiles, chromeos_unittests, app_shell_unittests
Review URL: https://codereview.chromium.org/925893003
Cr-Commit-Position: refs/heads/master@{#316698}
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/shell/app_shell.gypi | 3 | ||||
-rw-r--r-- | extensions/shell/browser/api/shell_gcd/shell_gcd_api.cc | 51 | ||||
-rw-r--r-- | extensions/shell/browser/api/shell_gcd/shell_gcd_api.h | 53 | ||||
-rw-r--r-- | extensions/shell/browser/api/shell_gcd/shell_gcd_api_unittest.cc | 57 | ||||
-rw-r--r-- | extensions/shell/common/api/schemas.gypi | 1 | ||||
-rw-r--r-- | extensions/shell/common/api/shell_gcd.idl | 24 |
6 files changed, 0 insertions, 189 deletions
diff --git a/extensions/shell/app_shell.gypi b/extensions/shell/app_shell.gypi index 8763e64..4c6bc8d 100644 --- a/extensions/shell/app_shell.gypi +++ b/extensions/shell/app_shell.gypi @@ -101,8 +101,6 @@ 'browser/shell_screen.h', ], 'app_shell_lib_sources_chromeos': [ - 'browser/api/shell_gcd/shell_gcd_api.cc', - 'browser/api/shell_gcd/shell_gcd_api.h', 'browser/api/vpn_provider/vpn_service_factory.cc', ], 'app_shell_lib_sources_nacl': [ @@ -129,7 +127,6 @@ 'browser/shell_screen_unittest.cc', ], 'app_shell_unittests_sources_chromeos': [ - 'browser/api/shell_gcd/shell_gcd_api_unittest.cc', 'browser/shell_audio_controller_chromeos_unittest.cc', ], 'app_shell_unittests_sources_nacl': [ diff --git a/extensions/shell/browser/api/shell_gcd/shell_gcd_api.cc b/extensions/shell/browser/api/shell_gcd/shell_gcd_api.cc deleted file mode 100644 index ea3d35c..0000000 --- a/extensions/shell/browser/api/shell_gcd/shell_gcd_api.cc +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "extensions/shell/browser/api/shell_gcd/shell_gcd_api.h" - -#include <string> - -#include "base/values.h" -#include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/privet_daemon_client.h" -#include "extensions/shell/common/api/shell_gcd.h" - -namespace gcd = extensions::shell::api::shell_gcd; - -namespace extensions { - -ShellGcdPingFunction::ShellGcdPingFunction() { -} - -ShellGcdPingFunction::~ShellGcdPingFunction() { -} - -ExtensionFunction::ResponseAction ShellGcdPingFunction::Run() { - // |this| is refcounted so we don't need the usual DBus callback WeakPtr. - chromeos::DBusThreadManager::Get()->GetPrivetDaemonClient()->Ping( - base::Bind(&ShellGcdPingFunction::OnPing, this)); - return RespondLater(); -} - -void ShellGcdPingFunction::OnPing(bool success) { - Respond(OneArgument(new base::FundamentalValue(success))); -} - -/////////////////////////////////////////////////////////////////////////////// - -ShellGcdGetWiFiBootstrapStateFunction::ShellGcdGetWiFiBootstrapStateFunction() { -} - -ShellGcdGetWiFiBootstrapStateFunction:: - ~ShellGcdGetWiFiBootstrapStateFunction() { -} - -ExtensionFunction::ResponseAction ShellGcdGetWiFiBootstrapStateFunction::Run() { - std::string state = chromeos::DBusThreadManager::Get() - ->GetPrivetDaemonClient() - ->GetWifiBootstrapState(); - return RespondNow(OneArgument(new base::StringValue(state))); -} - -} // namespace extensions diff --git a/extensions/shell/browser/api/shell_gcd/shell_gcd_api.h b/extensions/shell/browser/api/shell_gcd/shell_gcd_api.h deleted file mode 100644 index 327f3aa..0000000 --- a/extensions/shell/browser/api/shell_gcd/shell_gcd_api.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef EXTENSIONS_SHELL_BROWSER_API_SHELL_GCD_SHELL_GCD_API_H_ -#define EXTENSIONS_SHELL_BROWSER_API_SHELL_GCD_SHELL_GCD_API_H_ - -#include "base/macros.h" -#include "extensions/browser/extension_function.h" - -namespace extensions { - -// Used for manual testing in app_shell. See shell_gcd.idl for documentation. -class ShellGcdPingFunction : public UIThreadExtensionFunction { - public: - DECLARE_EXTENSION_FUNCTION("shell.gcd.ping", UNKNOWN); - - ShellGcdPingFunction(); - - protected: - ~ShellGcdPingFunction() override; - - // ExtensionFunction: - ResponseAction Run() override; - - private: - // Callback for status from DBus call to GCD privet daemon. - void OnPing(bool success); - - DISALLOW_COPY_AND_ASSIGN(ShellGcdPingFunction); -}; - -/////////////////////////////////////////////////////////////////////////////// - -// Used for manual testing in app_shell. See shell_gcd.idl for documentation. -class ShellGcdGetWiFiBootstrapStateFunction : public UIThreadExtensionFunction { - public: - DECLARE_EXTENSION_FUNCTION("shell.gcd.getWiFiBootstrapState", UNKNOWN); - - ShellGcdGetWiFiBootstrapStateFunction(); - - // ExtensionFunction: - ResponseAction Run() override; - - private: - ~ShellGcdGetWiFiBootstrapStateFunction() override; - - DISALLOW_COPY_AND_ASSIGN(ShellGcdGetWiFiBootstrapStateFunction); -}; - -} // namespace extensions - -#endif // EXTENSIONS_SHELL_BROWSER_API_SHELL_GCD_SHELL_GCD_API_H_ diff --git a/extensions/shell/browser/api/shell_gcd/shell_gcd_api_unittest.cc b/extensions/shell/browser/api/shell_gcd/shell_gcd_api_unittest.cc deleted file mode 100644 index 66e4401..0000000 --- a/extensions/shell/browser/api/shell_gcd/shell_gcd_api_unittest.cc +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "extensions/shell/browser/api/shell_gcd/shell_gcd_api.h" - -#include <string> - -#include "base/memory/scoped_ptr.h" -#include "base/values.h" -#include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/dbus/privet_daemon_client.h" -#include "extensions/browser/api_unittest.h" - -namespace extensions { - -class ShellGcdApiTest : public ApiUnitTest { - public: - ShellGcdApiTest() {} - ~ShellGcdApiTest() override {} - - // testing::Test overrides: - void SetUp() override { - ApiUnitTest::SetUp(); - chromeos::DBusThreadManager::Initialize(); - } - - void TearDown() override { - chromeos::DBusThreadManager::Shutdown(); - ApiUnitTest::TearDown(); - } - - private: - DISALLOW_COPY_AND_ASSIGN(ShellGcdApiTest); -}; - -TEST_F(ShellGcdApiTest, Ping) { - // Function succeeds and returns a result (for its callback). - scoped_ptr<base::Value> result = - RunFunctionAndReturnValue(new ShellGcdPingFunction, "[{}]"); - ASSERT_TRUE(result.get()); - bool success = false; - result->GetAsBoolean(&success); - EXPECT_TRUE(success); -} - -TEST_F(ShellGcdApiTest, GetWiFiBootstrapState) { - // Function succeeds and returns a result (for its callback). - scoped_ptr<base::Value> result = RunFunctionAndReturnValue( - new ShellGcdGetWiFiBootstrapStateFunction, "[{}]"); - ASSERT_TRUE(result.get()); - std::string state; - result->GetAsString(&state); - EXPECT_EQ(privetd::kWiFiBootstrapStateMonitoring, state); -} - -} // namespace extensions diff --git a/extensions/shell/common/api/schemas.gypi b/extensions/shell/common/api/schemas.gypi index 201628b..f257f9b 100644 --- a/extensions/shell/common/api/schemas.gypi +++ b/extensions/shell/common/api/schemas.gypi @@ -14,7 +14,6 @@ ], # Chrome OS specific APIs. 'chromeos_schema_files': [ - 'shell_gcd.idl', ], 'chromium_code': 1, diff --git a/extensions/shell/common/api/shell_gcd.idl b/extensions/shell/common/api/shell_gcd.idl deleted file mode 100644 index 65c80300..0000000 --- a/extensions/shell/common/api/shell_gcd.idl +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Setup related functions for a Google Cloud Devices (GCD) target device -// running on Chrome OS Core. The actual bootstrapping and GCD registration is -// handled by the privetd and buffet system daemons. -// -// TODO(jamescook): This API exists only for manual testing of GCD in app_shell. -// Delete it when GCD setup is integrated into OOBE. -namespace shell.gcd { - - callback PingCallback = void(boolean success); - callback StateCallback = void(DOMString state); - - interface Functions { - // Attempts to ping the daemon via D-Bus. - static void ping(PingCallback callback); - - // Returns the Wi-Fi bootstrap state. Return values are found in - // platform2/privetd/dbus_bindings/org.chromium.privetd.Manager.xml. - static void getWiFiBootstrapState(StateCallback callback); - }; -}; |