| OLD | NEW | 
|    1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2012 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 "cloud_print/service/win/chrome_launcher.h" |    5 #include "cloud_print/service/win/chrome_launcher.h" | 
|    6  |    6  | 
|    7 #include "base/base_switches.h" |    7 #include "base/base_switches.h" | 
|    8 #include "base/command_line.h" |    8 #include "base/command_line.h" | 
|    9 #include "base/files/file_util.h" |    9 #include "base/files/file_util.h" | 
|   10 #include "base/files/scoped_temp_dir.h" |   10 #include "base/files/scoped_temp_dir.h" | 
|   11 #include "base/json/json_reader.h" |   11 #include "base/json/json_reader.h" | 
|   12 #include "base/json/json_writer.h" |   12 #include "base/json/json_writer.h" | 
|   13 #include "base/process/process.h" |   13 #include "base/process/process.h" | 
|   14 #include "base/process/process.h" |   14 #include "base/process/process.h" | 
|   15 #include "base/values.h" |   15 #include "base/values.h" | 
|   16 #include "base/win/registry.h" |   16 #include "base/win/registry.h" | 
|   17 #include "base/win/scoped_handle.h" |   17 #include "base/win/scoped_handle.h" | 
|   18 #include "base/win/scoped_process_information.h" |   18 #include "base/win/scoped_process_information.h" | 
|   19 #include "chrome/common/chrome_constants.h" |   19 #include "chrome/common/chrome_constants.h" | 
|   20 #include "chrome/common/chrome_switches.h" |   20 #include "chrome/common/chrome_switches.h" | 
|   21 #include "chrome/common/pref_names.h" |   21 #include "chrome/common/pref_names.h" | 
|   22 #include "chrome/installer/launcher_support/chrome_launcher_support.h" |   22 #include "chrome/installer/launcher_support/chrome_launcher_support.h" | 
|   23 #include "cloud_print/common/win/cloud_print_utils.h" |   23 #include "cloud_print/common/win/cloud_print_utils.h" | 
|   24 #include "cloud_print/service/service_constants.h" |   24 #include "cloud_print/service/service_constants.h" | 
|   25 #include "cloud_print/service/win/service_utils.h" |   25 #include "cloud_print/service/win/service_utils.h" | 
 |   26 #include "components/browser_sync/common/browser_sync_switches.h" | 
|   26 #include "components/cloud_devices/common/cloud_devices_urls.h" |   27 #include "components/cloud_devices/common/cloud_devices_urls.h" | 
|   27 #include "content/public/common/content_switches.h" |   28 #include "content/public/common/content_switches.h" | 
|   28 #include "google_apis/gaia/gaia_urls.h" |   29 #include "google_apis/gaia/gaia_urls.h" | 
|   29 #include "net/base/url_util.h" |   30 #include "net/base/url_util.h" | 
|   30 #include "url/gurl.h" |   31 #include "url/gurl.h" | 
|   31  |   32  | 
|   32 namespace { |   33 namespace { | 
|   33  |   34  | 
|   34 const int kShutdownTimeoutMs = 30 * 1000; |   35 const int kShutdownTimeoutMs = 30 * 1000; | 
|   35 const int kUsageUpdateTimeoutMs = 6 * 3600 * 1000;  // 6 hours. |   36 const int kUsageUpdateTimeoutMs = 6 * 3600 * 1000;  // 6 hours. | 
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  321       LOG(ERROR) << "Chrome launch failed."; |  322       LOG(ERROR) << "Chrome launch failed."; | 
|  322       return std::string(); |  323       return std::string(); | 
|  323     } |  324     } | 
|  324     if (!json.empty()) { |  325     if (!json.empty()) { | 
|  325       // Close chrome because Service State is ready. |  326       // Close chrome because Service State is ready. | 
|  326       CloseChrome(chrome_process.Pass(), thread_id); |  327       CloseChrome(chrome_process.Pass(), thread_id); | 
|  327       return json; |  328       return json; | 
|  328     } |  329     } | 
|  329   } |  330   } | 
|  330 } |  331 } | 
| OLD | NEW |