summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_main.cc3
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc13
-rw-r--r--chrome/browser/remoting/remoting_setup_flow.cc11
-rw-r--r--chrome/browser/service/service_process_control.cc8
-rw-r--r--chrome/browser/service/service_process_control.h9
-rw-r--r--chrome/browser/service/service_process_control_browsertest.cc3
-rw-r--r--chrome/browser/service/service_process_control_manager.cc4
-rw-r--r--chrome/browser/service/service_process_control_manager.h8
8 files changed, 18 insertions, 41 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 1679475..a922f06 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -81,7 +81,6 @@
#include "chrome/common/net/net_resource_provider.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/result_codes.h"
-#include "chrome/common/service_process_type.h"
#include "chrome/installer/util/google_update_settings.h"
#include "chrome/installer/util/master_preferences.h"
#include "grit/app_locale_settings.h"
@@ -1426,7 +1425,7 @@ int BrowserMain(const MainFunctionParams& parameters) {
if (parsed_command_line.HasSwitch(switches::kEnableRemoting)) {
if (user_prefs->GetBoolean(prefs::kRemotingHasSetupCompleted)) {
ServiceProcessControl* control = ServiceProcessControlManager::instance()
- ->GetProcessControl(profile, kServiceProcessRemoting);
+ ->GetProcessControl(profile);
control->Launch(NULL);
}
}
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
index 2dfc19f..c6e459a 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc
@@ -34,7 +34,6 @@
#include "chrome/common/net/gaia/google_service_auth_error.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/service_messages.h"
-#include "chrome/common/service_process_type.h"
#include "gfx/font.h"
#include "grit/locale_settings.h"
@@ -93,9 +92,7 @@ class CloudPrintServiceDisableTask
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
process_control_ =
- ServiceProcessControlManager::instance()->GetProcessControl(
- profile_,
- kServiceProcessCloudPrint);
+ ServiceProcessControlManager::instance()->GetProcessControl(profile_);
if (process_control_) {
// If the process isn't connected, launch it now. This will run
@@ -145,9 +142,7 @@ class CloudPrintServiceRefreshTask
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
process_control_ =
- ServiceProcessControlManager::instance()->GetProcessControl(
- profile_,
- kServiceProcessCloudPrint);
+ ServiceProcessControlManager::instance()->GetProcessControl(profile_);
if (process_control_) {
// If the process isn't connected, launch it now. This will run
@@ -351,9 +346,7 @@ void CloudPrintSetupFlow::OnClientLoginSuccess(
// If we have already connected to the service process then submit the tokens
// to it to register the host.
process_control_ =
- ServiceProcessControlManager::instance()->GetProcessControl(
- profile_,
- kServiceProcessCloudPrint);
+ ServiceProcessControlManager::instance()->GetProcessControl(profile_);
#if defined(OS_WIN)
// TODO(hclam): This call only works on Windows. I need to make it
diff --git a/chrome/browser/remoting/remoting_setup_flow.cc b/chrome/browser/remoting/remoting_setup_flow.cc
index 856fd72..f2c3c33 100644
--- a/chrome/browser/remoting/remoting_setup_flow.cc
+++ b/chrome/browser/remoting/remoting_setup_flow.cc
@@ -27,7 +27,6 @@
#include "chrome/common/net/gaia/gaia_constants.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
#include "chrome/common/pref_names.h"
-#include "chrome/common/service_process_type.h"
#include "gfx/font.h"
#include "grit/locale_settings.h"
@@ -41,10 +40,10 @@ static const wchar_t kDoneIframeXPath[] = L"//iframe[@id='done']";
// is connected or launched. The events are sent back to RemotingSetupFlow
// when the dialog is still active. RemotingSetupFlow can detach from this
// helper class when the dialog is closed.
-class RemotingServiceProcessHelper :
- public base::RefCountedThreadSafe<RemotingServiceProcessHelper> {
+class RemotingServiceProcessHelper
+ : public base::RefCountedThreadSafe<RemotingServiceProcessHelper> {
public:
- RemotingServiceProcessHelper(RemotingSetupFlow* flow)
+ explicit RemotingServiceProcessHelper(RemotingSetupFlow* flow)
: flow_(flow) {
}
@@ -205,9 +204,7 @@ void RemotingSetupFlow::OnIssueAuthTokenSuccess(const std::string& service,
// If we have already connected to the service process then submit the tokens
// to it to register the host.
process_control_ =
- ServiceProcessControlManager::instance()->GetProcessControl(
- profile_,
- kServiceProcessRemoting);
+ ServiceProcessControlManager::instance()->GetProcessControl(profile_);
if (process_control_->is_connected()) {
// TODO(hclam): Need to figure out what to do when the service process is
diff --git a/chrome/browser/service/service_process_control.cc b/chrome/browser/service/service_process_control.cc
index c3c16d8..6af47c3 100644
--- a/chrome/browser/service/service_process_control.cc
+++ b/chrome/browser/service/service_process_control.cc
@@ -50,7 +50,7 @@ class ServiceProcessControl::Launcher
}
void DoDetectLaunched(Task* task) {
- if (CheckServiceProcessRunning(kServiceProcessCloudPrint)) {
+ if (CheckServiceProcessRunning()) {
ChromeThread::PostTask(ChromeThread::UI, FROM_HERE,
NewRunnableMethod(this, &Launcher::Notify, task));
return;
@@ -75,10 +75,8 @@ class ServiceProcessControl::Launcher
};
// ServiceProcessControl implementation.
-ServiceProcessControl::ServiceProcessControl(Profile* profile,
- ServiceProcessType type)
+ServiceProcessControl::ServiceProcessControl(Profile* profile)
: profile_(profile),
- type_(type),
message_handler_(NULL) {
}
@@ -116,7 +114,7 @@ void ServiceProcessControl::Launch(Task* task) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
// If the service process is already running then connects to it.
- if (CheckServiceProcessRunning(kServiceProcessCloudPrint)) {
+ if (CheckServiceProcessRunning()) {
ConnectInternal(task);
return;
}
diff --git a/chrome/browser/service/service_process_control.h b/chrome/browser/service/service_process_control.h
index 46c2a18..021b669 100644
--- a/chrome/browser/service/service_process_control.h
+++ b/chrome/browser/service/service_process_control.h
@@ -13,7 +13,6 @@
#include "base/process.h"
#include "base/scoped_ptr.h"
#include "base/task.h"
-#include "chrome/common/service_process_type.h"
#include "ipc/ipc_sync_channel.h"
class Profile;
@@ -43,16 +42,13 @@ class ServiceProcessControl : public IPC::Channel::Sender,
virtual void OnGoodDay() = 0;
};
- // Construct a ServiceProcessControl with |profile| and a specific |type|.
- ServiceProcessControl(Profile* profile, ServiceProcessType type);
+ // Construct a ServiceProcessControl with |profile|..
+ explicit ServiceProcessControl(Profile* profile);
virtual ~ServiceProcessControl();
// Return the user profile associated with this service process.
Profile* profile() const { return profile_; }
- // Return the type of this object.
- ServiceProcessType type() const { return type_; }
-
// Return true if this object is connected to the service.
bool is_connected() const { return channel_.get() != NULL; }
@@ -114,7 +110,6 @@ class ServiceProcessControl : public IPC::Channel::Sender,
void ConnectInternal(Task* task);
Profile* profile_;
- ServiceProcessType type_;
// IPC channel to the service process.
scoped_ptr<IPC::SyncChannel> channel_;
diff --git a/chrome/browser/service/service_process_control_browsertest.cc b/chrome/browser/service/service_process_control_browsertest.cc
index 854a7ab..391f99f 100644
--- a/chrome/browser/service/service_process_control_browsertest.cc
+++ b/chrome/browser/service/service_process_control_browsertest.cc
@@ -7,7 +7,6 @@
#include "chrome/browser/browser.h"
#include "chrome/browser/service/service_process_control.h"
#include "chrome/browser/service/service_process_control_manager.h"
-#include "chrome/common/service_process_type.h"
class ServiceProcessControlBrowserTest
: public InProcessBrowserTest,
@@ -16,7 +15,7 @@ class ServiceProcessControlBrowserTest
void LaunchServiceProcessControl() {
ServiceProcessControl* process =
ServiceProcessControlManager::instance()->GetProcessControl(
- browser()->profile(), kServiceProcessCloudPrint);
+ browser()->profile());
process_ = process;
// Launch the process asynchronously.
diff --git a/chrome/browser/service/service_process_control_manager.cc b/chrome/browser/service/service_process_control_manager.cc
index 5750970..5e391a8 100644
--- a/chrome/browser/service/service_process_control_manager.cc
+++ b/chrome/browser/service/service_process_control_manager.cc
@@ -18,7 +18,7 @@ ServiceProcessControlManager::~ServiceProcessControlManager() {
}
ServiceProcessControl* ServiceProcessControlManager::GetProcessControl(
- Profile* profile, ServiceProcessType type) {
+ Profile* profile) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
// TODO(hclam): We will have different service process for different types of
@@ -30,7 +30,7 @@ ServiceProcessControl* ServiceProcessControlManager::GetProcessControl(
}
// Couldn't find a ServiceProcess so construct a new one.
- ServiceProcessControl* process = new ServiceProcessControl(profile, type);
+ ServiceProcessControl* process = new ServiceProcessControl(profile);
process_control_list_.push_back(process);
return process;
}
diff --git a/chrome/browser/service/service_process_control_manager.h b/chrome/browser/service/service_process_control_manager.h
index c57f65c..a57c43e 100644
--- a/chrome/browser/service/service_process_control_manager.h
+++ b/chrome/browser/service/service_process_control_manager.h
@@ -7,8 +7,6 @@
#include <vector>
-#include "chrome/common/service_process_type.h"
-
class Profile;
class ServiceProcessControl;
@@ -25,12 +23,10 @@ class ServiceProcessControlManager {
// Get the ServiceProcess instance corresponding to |profile| and |type|.
// If such an instance doesn't exist a new instance is created.
//
- // There will be at most one ServiceProcess for a |profile| and |type|
- // pair.
+ // There will be at most one ServiceProcess for a |profile|.
//
// This method should only be accessed on the UI thread.
- ServiceProcessControl* GetProcessControl(Profile* profile,
- ServiceProcessType type);
+ ServiceProcessControl* GetProcessControl(Profile* profile);
// Destroy all ServiceProcess objects created.
void Shutdown();