Commit 7d54a195 authored by zork@chromium.org's avatar zork@chromium.org

Move Chrome OS pairing interface to chrome/browser/chromeos

BUG=393413

Review URL: https://codereview.chromium.org/387163002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284549 0039d316-1c4b-4281-b951-d872f2087c98
parent 90e1a1b9
include_rules = [
"+components/pairing",
"+components/onc",
"+cros",
"+dbus",
......
......@@ -9,10 +9,11 @@
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/login/auth/user_context.h"
#include "chromeos/pairing/fake_controller_pairing_controller.h"
#include "components/pairing/fake_controller_pairing_controller.h"
#include "google_apis/gaia/gaia_auth_util.h"
using namespace chromeos::controller_pairing;
using namespace pairing_chromeos;
namespace chromeos {
......
......@@ -10,20 +10,21 @@
#include "chrome/browser/chromeos/login/screens/controller_pairing_screen_actor.h"
#include "chrome/browser/chromeos/login/screens/screen_context.h"
#include "chrome/browser/chromeos/login/screens/wizard_screen.h"
#include "chromeos/pairing/controller_pairing_controller.h"
#include "components/pairing/controller_pairing_controller.h"
namespace chromeos {
class ControllerPairingScreen : public WizardScreen,
public ControllerPairingController::Observer,
public ControllerPairingScreenActor::Delegate {
class ControllerPairingScreen :
public WizardScreen,
public pairing_chromeos::ControllerPairingController::Observer,
public ControllerPairingScreenActor::Delegate {
public:
ControllerPairingScreen(ScreenObserver* observer,
ControllerPairingScreenActor* actor);
virtual ~ControllerPairingScreen();
private:
typedef ControllerPairingController::Stage Stage;
typedef pairing_chromeos::ControllerPairingController::Stage Stage;
void CommitContextChanges();
bool ExpectStageIs(Stage stage) const;
......@@ -34,7 +35,7 @@ class ControllerPairingScreen : public WizardScreen,
virtual void Hide() OVERRIDE;
virtual std::string GetName() const OVERRIDE;
// Overridden from ControllerPairingController::Observer:
// Overridden from pairing_chromeos::ControllerPairingController::Observer:
virtual void PairingStageChanged(Stage new_stage) OVERRIDE;
virtual void DiscoveredDevicesListChanged() OVERRIDE;
......@@ -52,7 +53,7 @@ class ControllerPairingScreen : public WizardScreen,
// Controller performing pairing. Owned by the screen for now.
// TODO(dzhioev): move to proper place later.
scoped_ptr<ControllerPairingController> controller_;
scoped_ptr<pairing_chromeos::ControllerPairingController> controller_;
// Current stage of pairing process.
Stage current_stage_;
......
......@@ -7,11 +7,12 @@
#include "base/command_line.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/pairing/fake_host_pairing_controller.h"
#include "components/pairing/fake_host_pairing_controller.h"
namespace chromeos {
using namespace host_pairing;
using namespace pairing_chromeos;
HostPairingScreen::HostPairingScreen(ScreenObserver* observer,
HostPairingScreenActor* actor)
......
......@@ -9,20 +9,22 @@
#include "chrome/browser/chromeos/login/screens/host_pairing_screen_actor.h"
#include "chrome/browser/chromeos/login/screens/screen_context.h"
#include "chrome/browser/chromeos/login/screens/wizard_screen.h"
#include "chromeos/pairing/host_pairing_controller.h"
#include "components/pairing/host_pairing_controller.h"
namespace chromeos {
class HostPairingScreen : public WizardScreen,
public HostPairingController::Observer,
public HostPairingScreenActor::Delegate {
class HostPairingScreen :
public WizardScreen,
public pairing_chromeos::HostPairingController::Observer,
public HostPairingScreenActor::Delegate {
public:
HostPairingScreen(ScreenObserver* observer, HostPairingScreenActor* actor);
virtual ~HostPairingScreen();
private:
typedef HostPairingController::Stage Stage;
typedef HostPairingController::UpdateProgress UpdateProgress;
typedef pairing_chromeos::HostPairingController::Stage Stage;
typedef pairing_chromeos::HostPairingController::UpdateProgress
UpdateProgress;
void CommitContextChanges();
......@@ -32,7 +34,7 @@ class HostPairingScreen : public WizardScreen,
virtual void Hide() OVERRIDE;
virtual std::string GetName() const OVERRIDE;
// Overridden from HostPairingController::Observer:
// Overridden from pairing_chromeos::HostPairingController::Observer:
virtual void PairingStageChanged(Stage new_stage) OVERRIDE;
virtual void UpdateAdvanced(const UpdateProgress& progress) OVERRIDE;
......@@ -47,7 +49,7 @@ class HostPairingScreen : public WizardScreen,
// Controller performing pairing. Owned by the screen for now.
// TODO(dzhioev): move to proper place later.
scoped_ptr<HostPairingController> controller_;
scoped_ptr<pairing_chromeos::HostPairingController> controller_;
// Current stage of pairing process.
Stage current_stage_;
......
......@@ -51,6 +51,7 @@
'../chromeos/ime/input_method.gyp:gencode',
'../components/components.gyp:cloud_policy_proto',
'../components/components.gyp:onc_component',
'../components/components.gyp:pairing',
'../components/components.gyp:policy',
'../components/components.gyp:session_manager_component',
'../components/components.gyp:user_manager',
......
......@@ -370,14 +370,6 @@
'network/shill_property_util.h',
'network/dhcp_proxy_script_fetcher_chromeos.cc',
'network/dhcp_proxy_script_fetcher_chromeos.h',
'pairing/fake_controller_pairing_controller.cc',
'pairing/fake_controller_pairing_controller.h',
'pairing/fake_host_pairing_controller.cc',
'pairing/fake_host_pairing_controller.h',
'pairing/controller_pairing_controller.cc',
'pairing/controller_pairing_controller.h',
'pairing/host_pairing_controller.cc',
'pairing/host_pairing_controller.h',
'process_proxy/process_output_watcher.cc',
'process_proxy/process_output_watcher.h',
'process_proxy/process_proxy.cc',
......
......@@ -85,6 +85,12 @@ group("all_components") {
]
}
if (is_chromeos) {
deps += [
"//components/pairing",
]
}
if (!is_ios) {
deps += [ "//components/keyed_service/content" ]
}
......
......@@ -77,6 +77,11 @@
'usb_service.gypi',
]
}],
['chromeos == 1', {
'includes': [
'pairing.gypi',
],
}],
['OS == "win" or OS == "mac"', {
'includes': [
'wifi.gypi',
......
# 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.
{
'targets': [
{
'target_name': 'pairing',
'type': 'static_library',
'include_dirs': [
'..',
],
'dependencies': [
'../base/base.gyp:base',
'../device/bluetooth/bluetooth.gyp:device_bluetooth',
],
'sources': [
'pairing/fake_controller_pairing_controller.cc',
'pairing/fake_controller_pairing_controller.h',
'pairing/fake_host_pairing_controller.cc',
'pairing/fake_host_pairing_controller.h',
'pairing/controller_pairing_controller.cc',
'pairing/controller_pairing_controller.h',
'pairing/host_pairing_controller.cc',
'pairing/host_pairing_controller.h',
],
},
],
}
# 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.
source_set("pairing") {
sources = [
"pairing/fake_controller_pairing_controller.cc",
"pairing/fake_controller_pairing_controller.h",
"pairing/fake_host_pairing_controller.cc",
"pairing/fake_host_pairing_controller.h",
"pairing/controller_pairing_controller.cc",
"pairing/controller_pairing_controller.h",
"pairing/host_pairing_controller.cc",
"pairing/host_pairing_controller.h",
]
deps = [
"//base",
"//device/bluetooth",
]
}
include_rules = [
"+device/bluetooth",
]
achuith@chromium.org
dzhioev@chromium.org
zork@chromium.org
......@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/pairing/controller_pairing_controller.h"
#include "components/pairing/controller_pairing_controller.h"
namespace chromeos {
namespace pairing_chromeos {
ControllerPairingController::Observer::Observer() {
}
......@@ -18,4 +18,4 @@ ControllerPairingController::ControllerPairingController() {
ControllerPairingController::~ControllerPairingController() {
}
} // namespace chromeos
} // namespace pairing_chromeos
......@@ -2,14 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_PAIRING_CONTROLLER_PAIRING_CONTROLLER_H_
#define CHROMEOS_PAIRING_CONTROLLER_PAIRING_CONTROLLER_H_
#ifndef COMPONENTS_PAIRING_CONTROLLER_PAIRING_CONTROLLER_H_
#define COMPONENTS_PAIRING_CONTROLLER_PAIRING_CONTROLLER_H_
#include <string>
#include <vector>
#include "base/macros.h"
#include "chromeos/chromeos_export.h"
namespace chromeos {
class UserContext;
......@@ -19,9 +18,9 @@ namespace content {
class BrowserContext;
}
namespace chromeos {
namespace pairing_chromeos {
class CHROMEOS_EXPORT ControllerPairingController {
class ControllerPairingController {
public:
enum Stage {
STAGE_NONE,
......@@ -104,6 +103,6 @@ class CHROMEOS_EXPORT ControllerPairingController {
DISALLOW_COPY_AND_ASSIGN(ControllerPairingController);
};
} // namespace chromeos
} // namespace pairing_chromeos
#endif // CHROMEOS_PAIRING_CONTROLLER_PAIRING_CONTROLLER_H_
#endif // COMPONENTS_PAIRING_CONTROLLER_PAIRING_CONTROLLER_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/pairing/fake_controller_pairing_controller.h"
#include "components/pairing/fake_controller_pairing_controller.h"
#include <map>
......@@ -14,7 +14,7 @@
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
namespace chromeos {
namespace pairing_chromeos {
FakeControllerPairingController::FakeControllerPairingController(
const std::string& config)
......@@ -332,4 +332,4 @@ void FakeControllerPairingController::PairingStageChanged(Stage new_stage) {
void FakeControllerPairingController::DiscoveredDevicesListChanged() {
}
} // namespace chromeos
} // namespace pairing_chromeos
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_PAIRING_FAKE_CONTROLLER_PAIRING_CONTROLLER_H_
#define CHROMEOS_PAIRING_FAKE_CONTROLLER_PAIRING_CONTROLLER_H_
#ifndef COMPONENTS_PAIRING_FAKE_CONTROLLER_PAIRING_CONTROLLER_H_
#define COMPONENTS_PAIRING_FAKE_CONTROLLER_PAIRING_CONTROLLER_H_
#include <set>
#include <utility>
......@@ -11,12 +11,11 @@
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/time/time.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/pairing/controller_pairing_controller.h"
#include "components/pairing/controller_pairing_controller.h"
namespace chromeos {
namespace pairing_chromeos {
class CHROMEOS_EXPORT FakeControllerPairingController
class FakeControllerPairingController
: public ControllerPairingController,
public ControllerPairingController::Observer {
public:
......@@ -106,6 +105,6 @@ class CHROMEOS_EXPORT FakeControllerPairingController
DISALLOW_COPY_AND_ASSIGN(FakeControllerPairingController);
};
} // namespace chromeos
} // namespace pairing_chromeos
#endif // CHROMEOS_PAIRING_FAKE_CONTROLLER_PAIRING_CONTROLLER_H_
#endif // COMPONENTS_PAIRING_FAKE_CONTROLLER_PAIRING_CONTROLLER_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/pairing/fake_host_pairing_controller.h"
#include "components/pairing/fake_host_pairing_controller.h"
#include <map>
#include <vector>
......@@ -22,7 +22,7 @@ const size_t kCodeLength = 6;
} // namespace
namespace chromeos {
namespace pairing_chromeos {
FakeHostPairingController::FakeHostPairingController(const std::string& config)
: current_stage_(STAGE_NONE),
......@@ -189,4 +189,4 @@ void FakeHostPairingController::PairingStageChanged(Stage new_stage) {
void FakeHostPairingController::UpdateAdvanced(const UpdateProgress& progress) {
}
} // namespace chromeos
} // namespace pairing_chromeos
......@@ -2,18 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_
#define CHROMEOS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_
#ifndef COMPONENTS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_
#define COMPONENTS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/time/time.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/pairing/host_pairing_controller.h"
#include "components/pairing/host_pairing_controller.h"
namespace chromeos {
namespace pairing_chromeos {
class CHROMEOS_EXPORT FakeHostPairingController
class FakeHostPairingController
: public HostPairingController,
public HostPairingController::Observer {
public:
......@@ -28,7 +27,7 @@ class CHROMEOS_EXPORT FakeHostPairingController
// empty, random code is generated.
// * device_name - string. Default: "Chromebox-01".
// * domain - string. Default: "example.com".
FakeHostPairingController(const std::string& config);
explicit FakeHostPairingController(const std::string& config);
virtual ~FakeHostPairingController();
// Applies given |config| to flow.
......@@ -69,6 +68,6 @@ class CHROMEOS_EXPORT FakeHostPairingController
DISALLOW_COPY_AND_ASSIGN(FakeHostPairingController);
};
} // namespace chromeos
} // namespace pairing_chromeos
#endif // CHROMEOS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_
#endif // COMPONENTS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_
......@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/pairing/host_pairing_controller.h"
#include "components/pairing/host_pairing_controller.h"
namespace chromeos {
namespace pairing_chromeos {
HostPairingController::HostPairingController() {}
......@@ -13,4 +13,4 @@ HostPairingController::~HostPairingController() {}
HostPairingController::Observer::Observer() {}
HostPairingController::Observer::~Observer() {}
} // namespace chromeos
} // namespace pairing_chromeos
......@@ -2,17 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_PAIRING_HOST_PAIRING_CONTROLLER_H_
#define CHROMEOS_PAIRING_HOST_PAIRING_CONTROLLER_H_
#ifndef COMPONENTS_PAIRING_HOST_PAIRING_CONTROLLER_H_
#define COMPONENTS_PAIRING_HOST_PAIRING_CONTROLLER_H_
#include <string>
#include "base/macros.h"
#include "chromeos/chromeos_export.h"
namespace chromeos {
namespace pairing_chromeos {
class CHROMEOS_EXPORT HostPairingController {
class HostPairingController {
public:
enum Stage {
STAGE_NONE,
......@@ -75,6 +74,6 @@ class CHROMEOS_EXPORT HostPairingController {
DISALLOW_COPY_AND_ASSIGN(HostPairingController);
};
} // namespace chromeos
} // namespace pairing_chromeos
#endif // CHROMEOS_PAIRING_HOST_PAIRING_CONTROLLER_H_
#endif // COMPONENTS_PAIRING_HOST_PAIRING_CONTROLLER_H_
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