| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 void CallCallbackOnIOThread(const LaunchedCallback& callback, | 71 void CallCallbackOnIOThread(const LaunchedCallback& callback, |
| 72 LaunchResult result, | 72 LaunchResult result, |
| 73 base::Process process, | 73 base::Process process, |
| 74 base::File read_file, | 74 base::File read_file, |
| 75 base::File write_file); | 75 base::File write_file); |
| 76 | 76 |
| 77 bool detached_; | 77 bool detached_; |
| 78 | 78 |
| 79 bool allow_user_level_hosts_; | 79 bool allow_user_level_hosts_; |
| 80 | 80 |
| 81 #if defined(OS_WIN) |
| 81 // Handle of the native window corresponding to the extension. | 82 // Handle of the native window corresponding to the extension. |
| 82 intptr_t window_handle_; | 83 intptr_t window_handle_; |
| 84 #endif // OS_WIN |
| 83 | 85 |
| 84 DISALLOW_COPY_AND_ASSIGN(Core); | 86 DISALLOW_COPY_AND_ASSIGN(Core); |
| 85 }; | 87 }; |
| 86 | 88 |
| 87 scoped_refptr<Core> core_; | 89 scoped_refptr<Core> core_; |
| 88 | 90 |
| 89 DISALLOW_COPY_AND_ASSIGN(NativeProcessLauncherImpl); | 91 DISALLOW_COPY_AND_ASSIGN(NativeProcessLauncherImpl); |
| 90 }; | 92 }; |
| 91 | 93 |
| 92 NativeProcessLauncherImpl::Core::Core(bool allow_user_level_hosts, | 94 NativeProcessLauncherImpl::Core::Core(bool allow_user_level_hosts, |
| 93 intptr_t window_handle) | 95 intptr_t window_handle) |
| 94 : detached_(false), | 96 : detached_(false), |
| 95 allow_user_level_hosts_(allow_user_level_hosts), | 97 allow_user_level_hosts_(allow_user_level_hosts) |
| 96 window_handle_(window_handle) { | 98 #if defined(OS_WIN) |
| 97 } | 99 , window_handle_(window_handle) |
| 100 #endif // OS_WIN |
| 101 {} |
| 98 | 102 |
| 99 NativeProcessLauncherImpl::Core::~Core() { | 103 NativeProcessLauncherImpl::Core::~Core() { |
| 100 DCHECK(detached_); | 104 DCHECK(detached_); |
| 101 } | 105 } |
| 102 | 106 |
| 103 void NativeProcessLauncherImpl::Core::Detach() { | 107 void NativeProcessLauncherImpl::Core::Detach() { |
| 104 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 108 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 105 detached_ = true; | 109 detached_ = true; |
| 106 } | 110 } |
| 107 | 111 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 intptr_t window_handle = 0; | 272 intptr_t window_handle = 0; |
| 269 #if defined(OS_WIN) | 273 #if defined(OS_WIN) |
| 270 window_handle = reinterpret_cast<intptr_t>( | 274 window_handle = reinterpret_cast<intptr_t>( |
| 271 views::HWNDForNativeView(native_view)); | 275 views::HWNDForNativeView(native_view)); |
| 272 #endif | 276 #endif |
| 273 return scoped_ptr<NativeProcessLauncher>( | 277 return scoped_ptr<NativeProcessLauncher>( |
| 274 new NativeProcessLauncherImpl(allow_user_level_hosts, window_handle)); | 278 new NativeProcessLauncherImpl(allow_user_level_hosts, window_handle)); |
| 275 } | 279 } |
| 276 | 280 |
| 277 } // namespace extensions | 281 } // namespace extensions |
| OLD | NEW |