Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5523)

Unified Diff: chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc

Issue 8620001: Cleanup pass from Cloud Print Proxy policy implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc
diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc
index 63766e9c80578c654cc08949e0153c2fb6bb0e38..7b31d3156d5d636150a9b49043b6647bb46c4cff 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc
@@ -165,8 +165,8 @@ void CloudPrintProxyService::TokenExpiredNotificationDone(bool keep_alive) {
void CloudPrintProxyService::ApplyCloudPrintConnectorPolicy() {
if (!profile_->GetPrefs()->GetBoolean(prefs::kCloudPrintProxyEnabled)) {
- std::string email;
- email = profile_->GetPrefs()->GetString(prefs::kCloudPrintEmail);
+ std::string email =
+ profile_->GetPrefs()->GetString(prefs::kCloudPrintEmail);
if (!email.empty()) {
DisableForUser();
profile_->GetPrefs()->SetString(prefs::kCloudPrintEmail, std::string());
@@ -183,17 +183,14 @@ void CloudPrintProxyService::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- if (type == chrome::NOTIFICATION_PREF_CHANGED) {
- ApplyCloudPrintConnectorPolicy();
- } else {
- NOTREACHED();
- }
+ DCHECK_EQ(chrome::NOTIFICATION_PREF_CHANGED, type);
+ ApplyCloudPrintConnectorPolicy();
}
void CloudPrintProxyService::RefreshCloudPrintProxyStatus() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
ServiceProcessControl* process_control = GetServiceProcessControl();
- DCHECK(process_control->is_connected());
+ DCHECK(process_control->IsConnected());
ServiceProcessControl::CloudPrintProxyInfoHandler callback =
base::Bind(&CloudPrintProxyService::ProxyInfoCallback,
base::Unretained(this));
@@ -204,7 +201,7 @@ void CloudPrintProxyService::RefreshCloudPrintProxyStatus() {
void CloudPrintProxyService::EnableCloudPrintProxy(const std::string& lsid,
const std::string& email) {
ServiceProcessControl* process_control = GetServiceProcessControl();
- DCHECK(process_control->is_connected());
+ DCHECK(process_control->IsConnected());
process_control->Send(new ServiceMsg_EnableCloudPrintProxy(lsid));
// Assume the IPC worked.
profile_->GetPrefs()->SetString(prefs::kCloudPrintEmail, email);
@@ -215,7 +212,7 @@ void CloudPrintProxyService::EnableCloudPrintProxyWithRobot(
const std::string& robot_email,
const std::string& user_email) {
ServiceProcessControl* process_control = GetServiceProcessControl();
- DCHECK(process_control->is_connected());
+ DCHECK(process_control->IsConnected());
process_control->Send(new ServiceMsg_EnableCloudPrintProxyWithRobot(
robot_auth_code,
robot_email,
@@ -226,7 +223,7 @@ void CloudPrintProxyService::EnableCloudPrintProxyWithRobot(
void CloudPrintProxyService::DisableCloudPrintProxy() {
ServiceProcessControl* process_control = GetServiceProcessControl();
- DCHECK(process_control->is_connected());
+ DCHECK(process_control->IsConnected());
process_control->Send(new ServiceMsg_DisableCloudPrintProxy);
// Assume the IPC worked.
profile_->GetPrefs()->SetString(prefs::kCloudPrintEmail, std::string());
« no previous file with comments | « no previous file | chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698