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

Side by Side Diff: remoting/host/plugin/daemon_controller_linux.cc

Issue 10161034: Making sure that UAC promts fired by the Chromoting plugin get focus (instead of being shown in the… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback Created 8 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/plugin/daemon_controller.h ('k') | remoting/host/plugin/daemon_controller_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "remoting/host/plugin/daemon_controller.h" 5 #include "remoting/host/plugin/daemon_controller.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 DaemonControllerLinux(); 56 DaemonControllerLinux();
57 57
58 virtual State GetState() OVERRIDE; 58 virtual State GetState() OVERRIDE;
59 virtual void GetConfig(const GetConfigCallback& callback) OVERRIDE; 59 virtual void GetConfig(const GetConfigCallback& callback) OVERRIDE;
60 virtual void SetConfigAndStart( 60 virtual void SetConfigAndStart(
61 scoped_ptr<base::DictionaryValue> config, 61 scoped_ptr<base::DictionaryValue> config,
62 const CompletionCallback& done_callback) OVERRIDE; 62 const CompletionCallback& done_callback) OVERRIDE;
63 virtual void UpdateConfig(scoped_ptr<base::DictionaryValue> config, 63 virtual void UpdateConfig(scoped_ptr<base::DictionaryValue> config,
64 const CompletionCallback& done_callback) OVERRIDE; 64 const CompletionCallback& done_callback) OVERRIDE;
65 virtual void Stop(const CompletionCallback& done_callback) OVERRIDE; 65 virtual void Stop(const CompletionCallback& done_callback) OVERRIDE;
66 virtual void SetWindow(void* window_handle) OVERRIDE;
66 67
67 private: 68 private:
68 FilePath GetConfigPath(); 69 FilePath GetConfigPath();
69 70
70 void DoGetConfig(const GetConfigCallback& callback); 71 void DoGetConfig(const GetConfigCallback& callback);
71 void DoSetConfigAndStart(scoped_ptr<base::DictionaryValue> config, 72 void DoSetConfigAndStart(scoped_ptr<base::DictionaryValue> config,
72 const CompletionCallback& done_callback); 73 const CompletionCallback& done_callback);
73 void DoUpdateConfig(scoped_ptr<base::DictionaryValue> config, 74 void DoUpdateConfig(scoped_ptr<base::DictionaryValue> config,
74 const CompletionCallback& done_callback); 75 const CompletionCallback& done_callback);
75 void DoStop(const CompletionCallback& done_callback); 76 void DoStop(const CompletionCallback& done_callback);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 &DaemonControllerLinux::DoUpdateConfig, base::Unretained(this), 174 &DaemonControllerLinux::DoUpdateConfig, base::Unretained(this),
174 base::Passed(&config), done_callback)); 175 base::Passed(&config), done_callback));
175 } 176 }
176 177
177 void DaemonControllerLinux::Stop(const CompletionCallback& done_callback) { 178 void DaemonControllerLinux::Stop(const CompletionCallback& done_callback) {
178 file_io_thread_.message_loop()->PostTask(FROM_HERE, base::Bind( 179 file_io_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
179 &DaemonControllerLinux::DoStop, base::Unretained(this), 180 &DaemonControllerLinux::DoStop, base::Unretained(this),
180 done_callback)); 181 done_callback));
181 } 182 }
182 183
184 void DaemonControllerLinux::SetWindow(void* window_handle) {
185 // noop
186 }
187
183 FilePath DaemonControllerLinux::GetConfigPath() { 188 FilePath DaemonControllerLinux::GetConfigPath() {
184 std::string filename = "host#" + GetMd5(net::GetHostName()) + ".json"; 189 std::string filename = "host#" + GetMd5(net::GetHostName()) + ".json";
185 return file_util::GetHomeDir(). 190 return file_util::GetHomeDir().
186 Append(".config/chrome-remote-desktop").Append(filename); 191 Append(".config/chrome-remote-desktop").Append(filename);
187 } 192 }
188 193
189 void DaemonControllerLinux::DoGetConfig(const GetConfigCallback& callback) { 194 void DaemonControllerLinux::DoGetConfig(const GetConfigCallback& callback) {
190 JsonHostConfig config(GetConfigPath()); 195 JsonHostConfig config(GetConfigPath());
191 scoped_ptr<base::DictionaryValue> result; 196 scoped_ptr<base::DictionaryValue> result;
192 if (config.Read()) { 197 if (config.Read()) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 done_callback.Run(result); 260 done_callback.Run(result);
256 } 261 }
257 262
258 } // namespace 263 } // namespace
259 264
260 scoped_ptr<DaemonController> remoting::DaemonController::Create() { 265 scoped_ptr<DaemonController> remoting::DaemonController::Create() {
261 return scoped_ptr<DaemonController>(new DaemonControllerLinux()); 266 return scoped_ptr<DaemonController>(new DaemonControllerLinux());
262 } 267 }
263 268
264 } // namespace remoting 269 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/plugin/daemon_controller.h ('k') | remoting/host/plugin/daemon_controller_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698