Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: content/renderer/render_widget.cc

Issue 2901443002: Do not skip updating composition info on Mac. (Closed)
Patch Set: Update comments. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698