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 <string> | 5 #include <string> |
6 #include <utility> | 6 #include <utility> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ppapi/c/dev/ppb_console_dev.h" | |
10 #include "ppapi/c/dev/ppb_cursor_control_dev.h" | 9 #include "ppapi/c/dev/ppb_cursor_control_dev.h" |
| 10 #include "ppapi/c/ppb_console.h" |
11 #include "ppapi/cpp/completion_callback.h" | 11 #include "ppapi/cpp/completion_callback.h" |
12 #include "ppapi/cpp/dev/font_dev.h" | 12 #include "ppapi/cpp/dev/font_dev.h" |
13 #include "ppapi/cpp/dev/ime_input_event_dev.h" | 13 #include "ppapi/cpp/dev/ime_input_event_dev.h" |
14 #include "ppapi/cpp/dev/text_input_dev.h" | 14 #include "ppapi/cpp/dev/text_input_dev.h" |
15 #include "ppapi/cpp/graphics_2d.h" | 15 #include "ppapi/cpp/graphics_2d.h" |
16 #include "ppapi/cpp/image_data.h" | 16 #include "ppapi/cpp/image_data.h" |
17 #include "ppapi/cpp/input_event.h" | 17 #include "ppapi/cpp/input_event.h" |
18 #include "ppapi/cpp/instance.h" | 18 #include "ppapi/cpp/instance.h" |
19 #include "ppapi/cpp/module.h" | 19 #include "ppapi/cpp/module.h" |
20 #include "ppapi/cpp/rect.h" | 20 #include "ppapi/cpp/rect.h" |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 } | 694 } |
695 | 695 |
696 device.PaintImageData(image, pp::Point(0, 0)); | 696 device.PaintImageData(image, pp::Point(0, 0)); |
697 device.Flush(pp::CompletionCallback(&OnFlush, this)); | 697 device.Flush(pp::CompletionCallback(&OnFlush, this)); |
698 } | 698 } |
699 | 699 |
700 static void OnFlush(void* user_data, int32_t result) {} | 700 static void OnFlush(void* user_data, int32_t result) {} |
701 | 701 |
702 // Prints a debug message. | 702 // Prints a debug message. |
703 void Log(const pp::Var& value) { | 703 void Log(const pp::Var& value) { |
704 const PPB_Console_Dev* console = reinterpret_cast<const PPB_Console_Dev*>( | 704 const PPB_Console* console = reinterpret_cast<const PPB_Console*>( |
705 pp::Module::Get()->GetBrowserInterface(PPB_CONSOLE_DEV_INTERFACE)); | 705 pp::Module::Get()->GetBrowserInterface(PPB_CONSOLE_INTERFACE)); |
706 if (!console) | 706 if (!console) |
707 return; | 707 return; |
708 console->Log(pp_instance(), PP_LOGLEVEL_LOG, value.pp_var()); | 708 console->Log(pp_instance(), PP_LOGLEVEL_LOG, value.pp_var()); |
709 } | 709 } |
710 | 710 |
711 // IME Control interface. | 711 // IME Control interface. |
712 TextFieldStatusHandler* status_handler_; | 712 TextFieldStatusHandler* status_handler_; |
713 | 713 |
714 // Remembers the size of this instance. | 714 // Remembers the size of this instance. |
715 pp::Size last_size_; | 715 pp::Size last_size_; |
(...skipping 11 matching lines...) Expand all Loading... |
727 } | 727 } |
728 }; | 728 }; |
729 | 729 |
730 namespace pp { | 730 namespace pp { |
731 | 731 |
732 Module* CreateModule() { | 732 Module* CreateModule() { |
733 return new MyModule(); | 733 return new MyModule(); |
734 } | 734 } |
735 | 735 |
736 } // namespace pp | 736 } // namespace pp |
OLD | NEW |