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 "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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // process. The failure also happens if we output nothing here. | 139 // process. The failure also happens if we output nothing here. |
140 // We need to investigate the reason for this failure and fix it. | 140 // We need to investigate the reason for this failure and fix it. |
141 // In the meantime this temporary hack of drawing an empty | 141 // In the meantime this temporary hack of drawing an empty |
142 // rectangle in the DC gets us by. | 142 // rectangle in the DC gets us by. |
143 Rectangle(dc, 0, 0, 0, 0); | 143 Rectangle(dc, 0, 0, 0, 0); |
144 } | 144 } |
145 #endif // defined(OS_WIN) | 145 #endif // defined(OS_WIN) |
146 | 146 |
147 namespace { | 147 namespace { |
148 | 148 |
149 #if !defined(TOUCH_UI) | |
150 // The default text input type is to regard the plugin always accept text input. | 149 // The default text input type is to regard the plugin always accept text input. |
151 // This is for allowing users to use input methods even on completely-IME- | 150 // This is for allowing users to use input methods even on completely-IME- |
152 // unaware plugins (e.g., PPAPI Flash or PDF plugin for M16). | 151 // unaware plugins (e.g., PPAPI Flash or PDF plugin for M16). |
153 // Plugins need to explicitly opt out the text input mode if they know | 152 // Plugins need to explicitly opt out the text input mode if they know |
154 // that they don't accept texts. | 153 // that they don't accept texts. |
155 const ui::TextInputType kPluginDefaultTextInputType = ui::TEXT_INPUT_TYPE_TEXT; | 154 const ui::TextInputType kPluginDefaultTextInputType = ui::TEXT_INPUT_TYPE_TEXT; |
156 #else | |
157 // On the other hand, for touch ui, accepting text input implies to pop up | |
158 // virtual keyboard always. It makes IME-unaware plugins almost unusable, | |
159 // and hence is disabled by default (codereview.chromium.org/7800044). | |
160 const ui::TextInputType kPluginDefaultTextInputType = ui::TEXT_INPUT_TYPE_NONE; | |
161 #endif | |
162 | 155 |
163 #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, np_name) \ | 156 #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, np_name) \ |
164 COMPILE_ASSERT(static_cast<int>(WebCursorInfo::webkit_name) \ | 157 COMPILE_ASSERT(static_cast<int>(WebCursorInfo::webkit_name) \ |
165 == static_cast<int>(np_name), \ | 158 == static_cast<int>(np_name), \ |
166 mismatching_enums) | 159 mismatching_enums) |
167 | 160 |
168 // <embed>/<object> attributes. | 161 // <embed>/<object> attributes. |
169 static const char kWidth[] = "width"; | 162 static const char kWidth[] = "width"; |
170 static const char kHeight[] = "height"; | 163 static const char kHeight[] = "height"; |
171 static const char kBorder[] = "border"; // According to w3c, deprecated. | 164 static const char kBorder[] = "border"; // According to w3c, deprecated. |
(...skipping 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2099 screen_size_for_fullscreen_ = gfx::Size(); | 2092 screen_size_for_fullscreen_ = gfx::Size(); |
2100 WebElement element = container_->element(); | 2093 WebElement element = container_->element(); |
2101 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2094 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
2102 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2095 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
2103 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2096 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
2104 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2097 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
2105 } | 2098 } |
2106 | 2099 |
2107 } // namespace ppapi | 2100 } // namespace ppapi |
2108 } // namespace webkit | 2101 } // namespace webkit |
OLD | NEW |