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

Side by Side Diff: chrome/browser/extensions/api/messaging/native_message_process_host.h

Issue 22532011: Pass handle of the native view window to the native messaging host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 7 years, 4 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
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 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "base/process/process.h" 14 #include "base/process/process.h"
15 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" 15 #include "chrome/browser/extensions/api/messaging/native_process_launcher.h"
16 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
17 #include "ui/gfx/native_widget_types.h"
17 18
18 namespace net { 19 namespace net {
19 20
20 class DrainableIOBuffer; 21 class DrainableIOBuffer;
21 class FileStream; 22 class FileStream;
22 class IOBuffer; 23 class IOBuffer;
23 class IOBufferWithSize; 24 class IOBufferWithSize;
24 25
25 } // namespace net 26 } // namespace net
26 27
(...skipping 18 matching lines...) Expand all
45 // Called on the UI thread. 46 // Called on the UI thread.
46 virtual void PostMessageFromNativeProcess(int port_id, 47 virtual void PostMessageFromNativeProcess(int port_id,
47 const std::string& message) = 0; 48 const std::string& message) = 0;
48 virtual void CloseChannel(int port_id, 49 virtual void CloseChannel(int port_id,
49 const std::string& error_message) = 0; 50 const std::string& error_message) = 0;
50 }; 51 };
51 52
52 virtual ~NativeMessageProcessHost(); 53 virtual ~NativeMessageProcessHost();
53 54
54 static scoped_ptr<NativeMessageProcessHost> Create( 55 static scoped_ptr<NativeMessageProcessHost> Create(
56 gfx::NativeView native_view,
55 base::WeakPtr<Client> weak_client_ui, 57 base::WeakPtr<Client> weak_client_ui,
56 const std::string& source_extension_id, 58 const std::string& source_extension_id,
57 const std::string& native_host_name, 59 const std::string& native_host_name,
58 int destination_port); 60 int destination_port);
59 61
60 // Create using specified |launcher|. Used in tests. 62 // Create using specified |launcher|. Used in tests.
61 static scoped_ptr<NativeMessageProcessHost> CreateWithLauncher( 63 static scoped_ptr<NativeMessageProcessHost> CreateWithLauncher(
62 base::WeakPtr<Client> weak_client_ui, 64 base::WeakPtr<Client> weak_client_ui,
63 const std::string& source_extension_id, 65 const std::string& source_extension_id,
64 const std::string& native_host_name, 66 const std::string& native_host_name,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 162
161 // Set to true when a write is pending. 163 // Set to true when a write is pending.
162 bool write_pending_; 164 bool write_pending_;
163 165
164 DISALLOW_COPY_AND_ASSIGN(NativeMessageProcessHost); 166 DISALLOW_COPY_AND_ASSIGN(NativeMessageProcessHost);
165 }; 167 };
166 168
167 } // namespace extensions 169 } // namespace extensions
168 170
169 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H _ 171 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGE_PROCESS_HOST_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698