Commit 089e3035 authored by satorux@chromium.org's avatar satorux@chromium.org

chromeos: Rename functions to be PascalCase.

As they are now virtual.

BUG=chromium-os:22197
TEST=chrome and tests build

Review URL: http://codereview.chromium.org/8400077

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107866 0039d316-1c4b-4281-b951-d872f2087c98
parent ae458e05
......@@ -157,10 +157,10 @@ void Speak(const char* speak_str, bool queue, bool interruptible) {
props.append(queue ? "1;" : "0;");
props.append("interruptible=");
props.append(interruptible ? "1;" : "0;");
chromeos::DBusThreadManager::Get()->speech_synthesizer_client()->
chromeos::DBusThreadManager::Get()->GetSpeechSynthesizerClient()->
SetSpeakProperties(props);
}
chromeos::DBusThreadManager::Get()->speech_synthesizer_client()->
chromeos::DBusThreadManager::Get()->GetSpeechSynthesizerClient()->
Speak(speak_str);
}
......
......@@ -19,7 +19,8 @@ class BluetoothAdapterImpl : public BluetoothAdapter,
explicit BluetoothAdapterImpl(const std::string& id) : id_(id) {
DBusThreadManager* dbus_thread_manager = DBusThreadManager::Get();
DCHECK(dbus_thread_manager);
bluetooth_adapter_client_ = dbus_thread_manager->bluetooth_adapter_client();
bluetooth_adapter_client_ =
dbus_thread_manager->GetBluetoothAdapterClient();
DCHECK(bluetooth_adapter_client_);
bluetooth_adapter_client_->AddObserver(this, id_);
}
......
......@@ -21,7 +21,8 @@ class BluetoothManagerImpl : public BluetoothManager,
BluetoothManagerImpl() : weak_ptr_factory_(this) {
DBusThreadManager* dbus_thread_manager = DBusThreadManager::Get();
DCHECK(dbus_thread_manager);
bluetooth_manager_client_ = dbus_thread_manager->bluetooth_manager_client();
bluetooth_manager_client_ =
dbus_thread_manager->GetBluetoothManagerClient();
DCHECK(bluetooth_manager_client_);
bluetooth_manager_client_->AddObserver(this);
......
......@@ -81,12 +81,12 @@ ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() {
// We should remove observers attached to D-Bus clients before
// DBusThreadManager is shut down.
if (session_manager_observer_.get()) {
chromeos::DBusThreadManager::Get()->session_manager_client()->
chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
RemoveObserver(session_manager_observer_.get());
}
if (brightness_observer_.get()) {
chromeos::DBusThreadManager::Get()->power_manager_client()->RemoveObserver(
brightness_observer_.get());
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()
->RemoveObserver(brightness_observer_.get());
}
chromeos::DBusThreadManager::Shutdown();
......@@ -146,12 +146,12 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() {
// Initialize the brightness observer so that we'll display an onscreen
// indication of brightness changes during login.
brightness_observer_.reset(new chromeos::BrightnessObserver());
chromeos::DBusThreadManager::Get()->power_manager_client()->AddObserver(
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(
brightness_observer_.get());
// Initialize the session manager observer so that we'll take actions
// per signals sent from the session manager.
session_manager_observer_.reset(new chromeos::SessionManagerObserver);
chromeos::DBusThreadManager::Get()->session_manager_client()->
chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
AddObserver(session_manager_observer_.get());
// Initialize the Chrome OS bluetooth subsystem
......
......@@ -75,32 +75,32 @@ class DBusThreadManagerImpl : public DBusThreadManager {
}
// DBusThreadManager override.
virtual BluetoothAdapterClient* bluetooth_adapter_client() OVERRIDE {
virtual BluetoothAdapterClient* GetBluetoothAdapterClient() OVERRIDE {
return bluetooth_adapter_client_.get();
}
// DBusThreadManager override.
virtual BluetoothManagerClient* bluetooth_manager_client() OVERRIDE {
virtual BluetoothManagerClient* GetBluetoothManagerClient() OVERRIDE {
return bluetooth_manager_client_.get();
}
// DBusThreadManager override.
virtual PowerManagerClient* power_manager_client() OVERRIDE {
virtual PowerManagerClient* GetPowerManagerClient() OVERRIDE {
return power_manager_client_.get();
}
// DBusThreadManager override.
virtual SensorsClient* sensors_client() OVERRIDE {
virtual SensorsClient* GetSensorsClient() OVERRIDE {
return sensors_client_.get();
}
// DBusThreadManager override.
virtual SessionManagerClient* session_manager_client() OVERRIDE {
virtual SessionManagerClient* GetSessionManagerClient() OVERRIDE {
return session_manager_client_.get();
}
// DBusThreadManager override.
virtual SpeechSynthesizerClient* speech_synthesizer_client() OVERRIDE {
virtual SpeechSynthesizerClient* GetSpeechSynthesizerClient() OVERRIDE {
return speech_synthesizer_client_.get();
}
......
......@@ -70,31 +70,31 @@ class DBusThreadManager {
// Returns the bluetooth adapter client, owned by DBusThreadManager.
// Do not cache this pointer and use it after DBusThreadManager is shut
// down.
virtual BluetoothAdapterClient* bluetooth_adapter_client() = 0;
virtual BluetoothAdapterClient* GetBluetoothAdapterClient() = 0;
// Returns the bluetooth manager client, owned by DBusThreadManager.
// Do not cache this pointer and use it after DBusThreadManager is shut
// down.
virtual BluetoothManagerClient* bluetooth_manager_client() = 0;
virtual BluetoothManagerClient* GetBluetoothManagerClient() = 0;
// Returns the power manager client, owned by DBusThreadManager.
// See also comments at session_manager_client().
virtual PowerManagerClient* power_manager_client() = 0;
virtual PowerManagerClient* GetPowerManagerClient() = 0;
// Returns the session manager client, owned by DBusThreadManager.
// Do not cache this pointer and use it after DBusThreadManager is shut
// down.
virtual SensorsClient* sensors_client() = 0;
virtual SensorsClient* GetSensorsClient() = 0;
// Returns the session manager client, owned by DBusThreadManager.
// Do not cache this pointer and use it after DBusThreadManager is shut
// down.
virtual SessionManagerClient* session_manager_client() = 0;
virtual SessionManagerClient* GetSessionManagerClient() = 0;
// Returns the speech synthesizer client, owned by DBusThreadManager.
// Do not cache this pointer and use it after DBusThreadManager is shut
// down.
virtual SpeechSynthesizerClient* speech_synthesizer_client() = 0;
virtual SpeechSynthesizerClient* GetSpeechSynthesizerClient() = 0;
virtual ~DBusThreadManager();
......
......@@ -22,17 +22,17 @@ MockDBusThreadManager::MockDBusThreadManager()
mock_sensors_client_(new MockSensorsClient),
mock_session_manager_client_(new MockSessionManagerClient),
mock_speech_synthesizer_client_(new MockSpeechSynthesizerClient) {
EXPECT_CALL(*this, bluetooth_adapter_client())
EXPECT_CALL(*this, GetBluetoothAdapterClient())
.WillRepeatedly(Return(mock_bluetooth_adapter_client_.get()));
EXPECT_CALL(*this, bluetooth_manager_client())
EXPECT_CALL(*this, GetBluetoothManagerClient())
.WillRepeatedly(Return(mock_bluetooth_manager_client()));
EXPECT_CALL(*this, power_manager_client())
EXPECT_CALL(*this, GetPowerManagerClient())
.WillRepeatedly(Return(mock_power_manager_client_.get()));
EXPECT_CALL(*this, sensors_client())
EXPECT_CALL(*this, GetSensorsClient())
.WillRepeatedly(Return(mock_sensors_client_.get()));
EXPECT_CALL(*this, session_manager_client())
EXPECT_CALL(*this, GetSessionManagerClient())
.WillRepeatedly(Return(mock_session_manager_client_.get()));
EXPECT_CALL(*this, speech_synthesizer_client())
EXPECT_CALL(*this, GetSpeechSynthesizerClient())
.WillRepeatedly(Return(mock_speech_synthesizer_client_.get()));
}
......
......@@ -27,12 +27,12 @@ class MockDBusThreadManager : public DBusThreadManager {
MockDBusThreadManager();
virtual ~MockDBusThreadManager();
MOCK_METHOD0(bluetooth_adapter_client, BluetoothAdapterClient*(void));
MOCK_METHOD0(bluetooth_manager_client, BluetoothManagerClient*(void));
MOCK_METHOD0(power_manager_client, PowerManagerClient*(void));
MOCK_METHOD0(sensors_client, SensorsClient*(void));
MOCK_METHOD0(session_manager_client, SessionManagerClient*(void));
MOCK_METHOD0(speech_synthesizer_client, SpeechSynthesizerClient*(void));
MOCK_METHOD0(GetBluetoothAdapterClient, BluetoothAdapterClient*(void));
MOCK_METHOD0(GetBluetoothManagerClient, BluetoothManagerClient*(void));
MOCK_METHOD0(GetPowerManagerClient, PowerManagerClient*(void));
MOCK_METHOD0(GetSensorsClient, SensorsClient*(void));
MOCK_METHOD0(GetSessionManagerClient, SessionManagerClient*(void));
MOCK_METHOD0(GetSpeechSynthesizerClient, SpeechSynthesizerClient*(void));
MockBluetoothAdapterClient* mock_bluetooth_adapter_client() {
return mock_bluetooth_adapter_client_.get();
......
......@@ -60,7 +60,7 @@ void EnterpriseExtensionObserver::CheckExtensionAndNotifyEntd(
// static
void EnterpriseExtensionObserver::NotifyEntd() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DBusThreadManager::Get()->session_manager_client()->RestartEntd();
DBusThreadManager::Get()->GetSessionManagerClient()->RestartEntd();
}
} // namespace chromeos
......@@ -351,7 +351,7 @@ void ShowLoginWizard(const std::string& first_screen_name,
display_host->StartWizard(first_screen_name, GURL());
chromeos::LoginUtils::Get()->PrewarmAuthentication();
chromeos::DBusThreadManager::Get()->session_manager_client()
chromeos::DBusThreadManager::Get()->GetSessionManagerClient()
->EmitLoginPromptReady();
// Set initial timezone if specified by customization.
......
......@@ -115,7 +115,7 @@ void ExistingUserController::Init(const UserVector& users) {
login_display_->Init(filtered_users, show_guest, show_new_user);
LoginUtils::Get()->PrewarmAuthentication();
DBusThreadManager::Get()->session_manager_client()->EmitLoginPromptReady();
DBusThreadManager::Get()->GetSessionManagerClient()->EmitLoginPromptReady();
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -385,7 +385,7 @@ class JobRestartRequest
private:
void RestartJob() {
if (BrowserThread::CurrentlyOn(BrowserThread::UI)) {
DBusThreadManager::Get()->session_manager_client()->RestartJob(
DBusThreadManager::Get()->GetSessionManagerClient()->RestartJob(
pid_, command_line_);
} else {
// This function can be called on FILE thread. See PostTask in the
......@@ -578,7 +578,7 @@ void LoginUtilsImpl::PrepareProfile(
if (CrosLibrary::Get()->EnsureLoaded()) {
btl->AddLoginTimeMarker("StartSession-Start", false);
DBusThreadManager::Get()->session_manager_client()->StartSession(
DBusThreadManager::Get()->GetSessionManagerClient()->StartSession(
username);
btl->AddLoginTimeMarker("StartSession-End", false);
}
......
......@@ -318,7 +318,7 @@ void ScreenLocker::Signout() {
#if defined(TOOLKIT_USES_GTK)
WmIpc::instance()->NotifyAboutSignout();
#endif
DBusThreadManager::Get()->session_manager_client()->StopSession();
DBusThreadManager::Get()->GetSessionManagerClient()->StopSession();
// Don't hide yet the locker because the chrome screen may become visible
// briefly.
......
......@@ -845,7 +845,7 @@ void StorePolicyOp::OnKeyOpComplete(const OwnerManager::KeyOpCode return_code,
void StorePolicyOp::RequestStorePolicy() {
std::string serialized;
if (policy_->SerializeToString(&serialized)) {
DBusThreadManager::Get()->session_manager_client()->StorePolicy(
DBusThreadManager::Get()->GetSessionManagerClient()->StorePolicy(
serialized,
base::Bind(&StorePolicyOp::OnBoolComplete, this));
} else {
......@@ -866,7 +866,7 @@ RetrievePolicyOp::RetrievePolicyOp(
RetrievePolicyOp::~RetrievePolicyOp() {}
void RetrievePolicyOp::Execute() {
DBusThreadManager::Get()->session_manager_client()->RetrievePolicy(
DBusThreadManager::Get()->GetSessionManagerClient()->RetrievePolicy(
base::Bind(&RetrievePolicyOp::OnStringComplete, this));
}
......
......@@ -321,7 +321,7 @@ void WebUILoginView::OnTabMainFrameFirstRender() {
emit_login_visible = true;
#endif
if (emit_login_visible)
chromeos::DBusThreadManager::Get()->session_manager_client()
chromeos::DBusThreadManager::Get()->GetSessionManagerClient()
->EmitLoginPromptVisible();
OobeUI* oobe_ui = static_cast<OobeUI*>(GetWebUI());
......
......@@ -197,12 +197,12 @@ void SystemKeyEventListener::GrabKey(int32 key, uint32 mask) {
}
void SystemKeyEventListener::OnBrightnessDown() {
DBusThreadManager::Get()->power_manager_client()->
DBusThreadManager::Get()->GetPowerManagerClient()->
DecreaseScreenBrightness(true);
}
void SystemKeyEventListener::OnBrightnessUp() {
DBusThreadManager::Get()->power_manager_client()->
DBusThreadManager::Get()->GetPowerManagerClient()->
IncreaseScreenBrightness();
}
......
......@@ -105,7 +105,7 @@ bool ExtensionTtsPlatformImplChromeOs::Speak(
}
chromeos::SpeechSynthesizerClient* speech_synthesizer_client =
chromeos::DBusThreadManager::Get()->speech_synthesizer_client();
chromeos::DBusThreadManager::Get()->GetSpeechSynthesizerClient();
if (!options.empty())
speech_synthesizer_client->SetSpeakProperties(options);
......@@ -119,7 +119,7 @@ bool ExtensionTtsPlatformImplChromeOs::Speak(
}
bool ExtensionTtsPlatformImplChromeOs::StopSpeaking() {
chromeos::DBusThreadManager::Get()->speech_synthesizer_client()->
chromeos::DBusThreadManager::Get()->GetSpeechSynthesizerClient()->
StopSpeaking();
return true;
}
......@@ -137,7 +137,7 @@ void ExtensionTtsPlatformImplChromeOs::PollUntilSpeechFinishes(
return;
}
chromeos::SpeechSynthesizerClient* speech_synthesizer_client =
chromeos::DBusThreadManager::Get()->speech_synthesizer_client();
chromeos::DBusThreadManager::Get()->GetSpeechSynthesizerClient();
speech_synthesizer_client->IsSpeaking(base::Bind(
&ExtensionTtsPlatformImplChromeOs::ContinuePollingIfSpeechIsNotFinished,
weak_ptr_factory_.GetWeakPtr(), utterance_id));
......
......@@ -325,7 +325,7 @@ void BrowserList::NotifyAndTerminate(bool fast_path) {
chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT) {
cros_library->GetUpdateLibrary()->RebootAfterUpdate();
} else {
chromeos::DBusThreadManager::Get()->session_manager_client()
chromeos::DBusThreadManager::Get()->GetSessionManagerClient()
->StopSession();
}
return;
......
......@@ -154,12 +154,12 @@ void SystemOptionsHandler::DecreaseScreenBrightnessCallback(
const ListValue* args) {
// Do not allow the options button to turn off the backlight, as that
// can make it very difficult to see the increase brightness button.
chromeos::DBusThreadManager::Get()->power_manager_client()->
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
DecreaseScreenBrightness(false);
}
void SystemOptionsHandler::IncreaseScreenBrightnessCallback(
const ListValue* args) {
chromeos::DBusThreadManager::Get()->power_manager_client()->
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
IncreaseScreenBrightness();
}
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