OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/service_listener.h" | 5 #include "cloud_print/service/win/service_listener.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 base::DictionaryValue environment; | 32 base::DictionaryValue environment; |
33 environment.Set(SetupListener::kPrintersJsonValueName, printers.release()); | 33 environment.Set(SetupListener::kPrintersJsonValueName, printers.release()); |
34 environment.SetBoolean(SetupListener::kXpsAvailableJsonValueName, | 34 environment.SetBoolean(SetupListener::kXpsAvailableJsonValueName, |
35 printing::XPSModule::Init()); | 35 printing::XPSModule::Init()); |
36 environment.SetString(SetupListener::kUserNameJsonValueName, | 36 environment.SetString(SetupListener::kUserNameJsonValueName, |
37 GetCurrentUserName()); | 37 GetCurrentUserName()); |
38 environment.SetString(SetupListener::kChromePathJsonValueName, | 38 environment.SetString(SetupListener::kChromePathJsonValueName, |
39 chrome_launcher_support::GetAnyChromePath().value()); | 39 chrome_launcher_support::GetAnyChromePath().value()); |
40 if (file_util::CreateDirectory(user_data_dir)) { | 40 if (base::CreateDirectory(user_data_dir)) { |
41 base::FilePath temp_file; | 41 base::FilePath temp_file; |
42 if (base::CreateTemporaryFileInDir(user_data_dir, &temp_file)) { | 42 if (base::CreateTemporaryFileInDir(user_data_dir, &temp_file)) { |
43 DCHECK(base::PathExists(temp_file)); | 43 DCHECK(base::PathExists(temp_file)); |
44 environment.SetString(SetupListener::kUserDataDirJsonValueName, | 44 environment.SetString(SetupListener::kUserDataDirJsonValueName, |
45 user_data_dir.value()); | 45 user_data_dir.value()); |
46 base::DeleteFile(temp_file, false); | 46 base::DeleteFile(temp_file, false); |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 std::string result; | 50 std::string result; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 IPC::Channel::MODE_CLIENT, this)); | 95 IPC::Channel::MODE_CLIENT, this)); |
96 channel_->Connect(); | 96 channel_->Connect(); |
97 } else { | 97 } else { |
98 ipc_thread_->message_loop()->PostDelayedTask( | 98 ipc_thread_->message_loop()->PostDelayedTask( |
99 FROM_HERE, | 99 FROM_HERE, |
100 base::Bind(&ServiceListener::Connect, base::Unretained(this)), | 100 base::Bind(&ServiceListener::Connect, base::Unretained(this)), |
101 base::TimeDelta::FromMilliseconds(500)); | 101 base::TimeDelta::FromMilliseconds(500)); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
OLD | NEW |