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 "chrome/browser/extensions/api/messaging/native_process_launcher.h" | 5 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 // Default implementation on NativeProcessLauncher interface. | 37 // Default implementation on NativeProcessLauncher interface. |
38 class NativeProcessLauncherImpl : public NativeProcessLauncher { | 38 class NativeProcessLauncherImpl : public NativeProcessLauncher { |
39 public: | 39 public: |
40 NativeProcessLauncherImpl(bool allow_user_level_hosts, | 40 NativeProcessLauncherImpl(bool allow_user_level_hosts, |
41 intptr_t native_window); | 41 intptr_t native_window); |
42 virtual ~NativeProcessLauncherImpl(); | 42 virtual ~NativeProcessLauncherImpl(); |
43 | 43 |
44 virtual void Launch(const GURL& origin, | 44 virtual void Launch(const GURL& origin, |
45 const std::string& native_host_name, | 45 const std::string& native_host_name, |
46 LaunchedCallback callback) const OVERRIDE; | 46 LaunchedCallback callback) const override; |
47 | 47 |
48 private: | 48 private: |
49 class Core : public base::RefCountedThreadSafe<Core> { | 49 class Core : public base::RefCountedThreadSafe<Core> { |
50 public: | 50 public: |
51 Core(bool allow_user_level_hosts, intptr_t native_window); | 51 Core(bool allow_user_level_hosts, intptr_t native_window); |
52 void Launch(const GURL& origin, | 52 void Launch(const GURL& origin, |
53 const std::string& native_host_name, | 53 const std::string& native_host_name, |
54 LaunchedCallback callback); | 54 LaunchedCallback callback); |
55 void Detach(); | 55 void Detach(); |
56 | 56 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 intptr_t window_handle = 0; | 264 intptr_t window_handle = 0; |
265 #if defined(OS_WIN) | 265 #if defined(OS_WIN) |
266 window_handle = reinterpret_cast<intptr_t>( | 266 window_handle = reinterpret_cast<intptr_t>( |
267 views::HWNDForNativeView(native_view)); | 267 views::HWNDForNativeView(native_view)); |
268 #endif | 268 #endif |
269 return scoped_ptr<NativeProcessLauncher>( | 269 return scoped_ptr<NativeProcessLauncher>( |
270 new NativeProcessLauncherImpl(allow_user_level_hosts, window_handle)); | 270 new NativeProcessLauncherImpl(allow_user_level_hosts, window_handle)); |
271 } | 271 } |
272 | 272 |
273 } // namespace extensions | 273 } // namespace extensions |
OLD | NEW |