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 | 5 |
6 // This project demonstrates how to migrate a Windows desktop app to Native | 6 // This project demonstrates how to migrate a Windows desktop app to Native |
7 // Client, running first as a Win32 application (define STEP1), then as a PPAPI | 7 // Client, running first as a Win32 application (define STEP1), then as a PPAPI |
8 // plugin (define STEP2 through STEP6), and finally as a Native Client module. | 8 // plugin (define STEP2 through STEP6), and finally as a Native Client module. |
9 | 9 |
10 // Start with STEP1 defined and the defines for STEP2 through STEP6 commented | 10 // Start with STEP1 defined and the defines for STEP2 through STEP6 commented |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // *** RUN YOUR MODULE IN THE WILD *** | 58 // *** RUN YOUR MODULE IN THE WILD *** |
59 // You can run your nexe outside of Visual Studio, directly from Chrome by | 59 // You can run your nexe outside of Visual Studio, directly from Chrome by |
60 // following these steps: | 60 // following these steps: |
61 // - Build STEP6 and verify the file | 61 // - Build STEP6 and verify the file |
62 // <project directory>/newlib/hello_nacl_plus/hello_nacl_plus.nexe exists | 62 // <project directory>/newlib/hello_nacl_plus/hello_nacl_plus.nexe exists |
63 // - Copy the folder <project directory>/hello_nacl_plus into your NaCl SDK's | 63 // - Copy the folder <project directory>/hello_nacl_plus into your NaCl SDK's |
64 // example directory. | 64 // example directory. |
65 // - Go to the NaCl SDK directory and launch the httpd.py server. | 65 // - Go to the NaCl SDK directory and launch the httpd.py server. |
66 // - Launch Chrome, go to about:flags and enable the Native Client flag and | 66 // - Launch Chrome, go to about:flags and enable the Native Client flag and |
67 // relaunch Chrome | 67 // relaunch Chrome |
68 // - Point Chrome at localhost:5103/hello_nacl_plus | 68 // - Point Chrome at http://localhost:5103/hello_nacl_plus |
69 | 69 |
70 #ifdef STEP6 | 70 #ifdef STEP6 |
71 // remove Windows-dependent code. | 71 // remove Windows-dependent code. |
72 #undef STEP1 | 72 #undef STEP1 |
73 #undef STEP3 | 73 #undef STEP3 |
74 #undef STEP4 | 74 #undef STEP4 |
75 #define NULL 0 | 75 #define NULL 0 |
76 #else | 76 #else |
77 // includes for Windows APIs. | 77 // includes for Windows APIs. |
78 #include <windows.h> | 78 #include <windows.h> |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 #endif | 355 #endif |
356 | 356 |
357 #ifdef STEP5 | 357 #ifdef STEP5 |
358 // Pass the text to the browser page, there is no separate app window anymore. | 358 // Pass the text to the browser page, there is no separate app window anymore. |
359 // The text is added as a new element to the page, it does not appear in the | 359 // The text is added as a new element to the page, it does not appear in the |
360 // module's embed view. | 360 // module's embed view. |
361 void InitInstanceInBrowserWindow() { | 361 void InitInstanceInBrowserWindow() { |
362 myInstance->PostMessage(pp::Var("Hello, Native Client!")); | 362 myInstance->PostMessage(pp::Var("Hello, Native Client!")); |
363 } | 363 } |
364 #endif | 364 #endif |
OLD | NEW |