OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // process. The failure also happens if we output nothing here. | 137 // process. The failure also happens if we output nothing here. |
138 // We need to investigate the reason for this failure and fix it. | 138 // We need to investigate the reason for this failure and fix it. |
139 // In the meantime this temporary hack of drawing an empty | 139 // In the meantime this temporary hack of drawing an empty |
140 // rectangle in the DC gets us by. | 140 // rectangle in the DC gets us by. |
141 Rectangle(dc, 0, 0, 0, 0); | 141 Rectangle(dc, 0, 0, 0, 0); |
142 } | 142 } |
143 #endif // defined(OS_WIN) | 143 #endif // defined(OS_WIN) |
144 | 144 |
145 namespace { | 145 namespace { |
146 | 146 |
147 #if !defined(TOUCH_UI) | |
148 // The default text input type is to regard the plugin always accept text input. | 147 // The default text input type is to regard the plugin always accept text input. |
149 // This is for allowing users to use input methods even on completely-IME- | 148 // This is for allowing users to use input methods even on completely-IME- |
150 // unaware plugins (e.g., PPAPI Flash or PDF plugin for M16). | 149 // unaware plugins (e.g., PPAPI Flash or PDF plugin for M16). |
151 // Plugins need to explicitly opt out the text input mode if they know | 150 // Plugins need to explicitly opt out the text input mode if they know |
152 // that they don't accept texts. | 151 // that they don't accept texts. |
153 const ui::TextInputType kPluginDefaultTextInputType = ui::TEXT_INPUT_TYPE_TEXT; | 152 const ui::TextInputType kPluginDefaultTextInputType = ui::TEXT_INPUT_TYPE_TEXT; |
154 #else | |
155 // On the other hand, for touch ui, accepting text input implies to pop up | |
156 // virtual keyboard always. It makes IME-unaware plugins almost unusable, | |
157 // and hence is disabled by default (codereview.chromium.org/7800044). | |
158 const ui::TextInputType kPluginDefaultTextInputType = ui::TEXT_INPUT_TYPE_NONE; | |
159 #endif | |
160 | 153 |
161 #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, np_name) \ | 154 #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, np_name) \ |
162 COMPILE_ASSERT(static_cast<int>(WebCursorInfo::webkit_name) \ | 155 COMPILE_ASSERT(static_cast<int>(WebCursorInfo::webkit_name) \ |
163 == static_cast<int>(np_name), \ | 156 == static_cast<int>(np_name), \ |
164 mismatching_enums) | 157 mismatching_enums) |
165 | 158 |
166 // <embed>/<object> attributes. | 159 // <embed>/<object> attributes. |
167 static const char kWidth[] = "width"; | 160 static const char kWidth[] = "width"; |
168 static const char kHeight[] = "height"; | 161 static const char kHeight[] = "height"; |
169 static const char kBorder[] = "border"; // According to w3c, deprecated. | 162 static const char kBorder[] = "border"; // According to w3c, deprecated. |
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2044 screen_size_for_fullscreen_ = gfx::Size(); | 2037 screen_size_for_fullscreen_ = gfx::Size(); |
2045 WebElement element = container_->element(); | 2038 WebElement element = container_->element(); |
2046 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2039 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
2047 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2040 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
2048 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2041 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
2049 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2042 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
2050 } | 2043 } |
2051 | 2044 |
2052 } // namespace ppapi | 2045 } // namespace ppapi |
2053 } // namespace webkit | 2046 } // namespace webkit |
OLD | NEW |