| 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 "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" | 
| 6 | 6 | 
| 7 #include <memory> | 7 #include <memory> | 
| 8 #include <utility> | 8 #include <utility> | 
| 9 | 9 | 
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" | 
| (...skipping 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1835 #if BUILDFLAG(ENABLE_PLUGINS) | 1835 #if BUILDFLAG(ENABLE_PLUGINS) | 
| 1836   if (focused_pepper_plugin_) | 1836   if (focused_pepper_plugin_) | 
| 1837     return focused_pepper_plugin_->text_input_type(); | 1837     return focused_pepper_plugin_->text_input_type(); | 
| 1838 #endif | 1838 #endif | 
| 1839   if (auto* controller = GetInputMethodController()) | 1839   if (auto* controller = GetInputMethodController()) | 
| 1840     return ConvertWebTextInputType(controller->TextInputType()); | 1840     return ConvertWebTextInputType(controller->TextInputType()); | 
| 1841   return ui::TEXT_INPUT_TYPE_NONE; | 1841   return ui::TEXT_INPUT_TYPE_NONE; | 
| 1842 } | 1842 } | 
| 1843 | 1843 | 
| 1844 void RenderWidget::UpdateCompositionInfo(bool immediate_request) { | 1844 void RenderWidget::UpdateCompositionInfo(bool immediate_request) { | 
| 1845   if (!monitor_composition_info_ && !immediate_request) | 1845 #if defined(OS_MACOSX) | 
|  | 1846   // On Mac without OOPIF, <webview> IME malfunctions if we skip update. | 
|  | 1847   // TODO(crbug.com/714771): Remove this platform-specific guard once we have | 
|  | 1848   // a proper fix for crbug.com/714771 or we launch OOPIF for <webview>. | 
|  | 1849   const bool may_skip_update = | 
|  | 1850       base::FeatureList::IsEnabled(::features::kGuestViewCrossProcessFrames); | 
|  | 1851 #else | 
|  | 1852   const bool may_skip_update = true; | 
|  | 1853 #endif | 
|  | 1854 | 
|  | 1855   if (may_skip_update && !monitor_composition_info_ && !immediate_request) | 
| 1846     return;  // Do not calculate composition info if not requested. | 1856     return;  // Do not calculate composition info if not requested. | 
| 1847 | 1857 | 
| 1848   TRACE_EVENT0("renderer", "RenderWidget::UpdateCompositionInfo"); | 1858   TRACE_EVENT0("renderer", "RenderWidget::UpdateCompositionInfo"); | 
| 1849   gfx::Range range; | 1859   gfx::Range range; | 
| 1850   std::vector<gfx::Rect> character_bounds; | 1860   std::vector<gfx::Rect> character_bounds; | 
| 1851 | 1861 | 
| 1852   if (GetTextInputType() == ui::TEXT_INPUT_TYPE_NONE) { | 1862   if (GetTextInputType() == ui::TEXT_INPUT_TYPE_NONE) { | 
| 1853     // Composition information is only available on editable node. | 1863     // Composition information is only available on editable node. | 
| 1854     range = gfx::Range::InvalidRange(); | 1864     range = gfx::Range::InvalidRange(); | 
| 1855   } else { | 1865   } else { | 
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2341     // browser side (https://crbug.com/669219). | 2351     // browser side (https://crbug.com/669219). | 
| 2342     // If there is no WebFrameWidget, then there will be no | 2352     // If there is no WebFrameWidget, then there will be no | 
| 2343     // InputMethodControllers for a WebLocalFrame. | 2353     // InputMethodControllers for a WebLocalFrame. | 
| 2344     return nullptr; | 2354     return nullptr; | 
| 2345   } | 2355   } | 
| 2346   return static_cast<blink::WebFrameWidget*>(GetWebWidget()) | 2356   return static_cast<blink::WebFrameWidget*>(GetWebWidget()) | 
| 2347       ->GetActiveWebInputMethodController(); | 2357       ->GetActiveWebInputMethodController(); | 
| 2348 } | 2358 } | 
| 2349 | 2359 | 
| 2350 }  // namespace content | 2360 }  // namespace content | 
| OLD | NEW | 
|---|