| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 5 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 
| 6 | 6 | 
| 7 #include <stack> | 7 #include <stack> | 
| 8 #include <vector> | 8 #include <vector> | 
| 9 | 9 | 
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" | 
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 117 void CloudPrintProxyService::OnTokenExpiredNotificationClick() { | 117 void CloudPrintProxyService::OnTokenExpiredNotificationClick() { | 
| 118   TokenExpiredNotificationDone(true); | 118   TokenExpiredNotificationDone(true); | 
| 119   // Clear the cached cloud print email pref so that the cloud print setup | 119   // Clear the cached cloud print email pref so that the cloud print setup | 
| 120   // flow happens. | 120   // flow happens. | 
| 121   profile_->GetPrefs()->SetString(prefs::kCloudPrintEmail, std::string()); | 121   profile_->GetPrefs()->SetString(prefs::kCloudPrintEmail, std::string()); | 
| 122   CloudPrintSetupFlow::OpenDialog(profile_, this, NULL); | 122   CloudPrintSetupFlow::OpenDialog(profile_, this, NULL); | 
| 123 } | 123 } | 
| 124 | 124 | 
| 125 void CloudPrintProxyService::TokenExpiredNotificationDone(bool keep_alive) { | 125 void CloudPrintProxyService::TokenExpiredNotificationDone(bool keep_alive) { | 
| 126   if (token_expired_delegate_.get()) { | 126   if (token_expired_delegate_.get()) { | 
| 127     g_browser_process->notification_ui_manager()->Cancel( | 127     g_browser_process->notification_ui_manager()->CancelById( | 
| 128         Notification(GURL(), GURL(), string16(), string16(), | 128         token_expired_delegate_->id()); | 
| 129                      token_expired_delegate_.get())); |  | 
| 130     token_expired_delegate_ = NULL; | 129     token_expired_delegate_ = NULL; | 
| 131     if (!keep_alive) | 130     if (!keep_alive) | 
| 132       BrowserList::EndKeepAlive(); | 131       BrowserList::EndKeepAlive(); | 
| 133   } | 132   } | 
| 134 } | 133 } | 
| 135 | 134 | 
| 136 void CloudPrintProxyService::OnDialogClosed() { | 135 void CloudPrintProxyService::OnDialogClosed() { | 
| 137   MessageLoop::current()->PostTask( | 136   MessageLoop::current()->PostTask( | 
| 138       FROM_HERE, NewRunnableFunction(&BrowserList::EndKeepAlive)); | 137       FROM_HERE, NewRunnableFunction(&BrowserList::EndKeepAlive)); | 
| 139 } | 138 } | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 174 } | 173 } | 
| 175 | 174 | 
| 176 bool CloudPrintProxyService::InvokeServiceTask(Task* task) { | 175 bool CloudPrintProxyService::InvokeServiceTask(Task* task) { | 
| 177   ServiceProcessControl* process_control = | 176   ServiceProcessControl* process_control = | 
| 178       ServiceProcessControlManager::instance()->GetProcessControl(profile_); | 177       ServiceProcessControlManager::instance()->GetProcessControl(profile_); | 
| 179   DCHECK(process_control); | 178   DCHECK(process_control); | 
| 180   if (process_control) | 179   if (process_control) | 
| 181     process_control->Launch(task, NULL); | 180     process_control->Launch(task, NULL); | 
| 182   return !!process_control; | 181   return !!process_control; | 
| 183 } | 182 } | 
| OLD | NEW | 
|---|