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 LOG(ERROR) << "UpdateCompositionInfo(): monitor=" |
| 1846 << monitor_composition_info_ |
| 1847 << ", perform=" |
| 1848 << (monitor_composition_info_ || immediate_request); |
| 1849 |
1845 if (!monitor_composition_info_ && !immediate_request) | 1850 if (!monitor_composition_info_ && !immediate_request) |
1846 return; // Do not calculate composition info if not requested. | 1851 return; // Do not calculate composition info if not requested. |
1847 | 1852 |
1848 TRACE_EVENT0("renderer", "RenderWidget::UpdateCompositionInfo"); | 1853 TRACE_EVENT0("renderer", "RenderWidget::UpdateCompositionInfo"); |
1849 gfx::Range range; | 1854 gfx::Range range; |
1850 std::vector<gfx::Rect> character_bounds; | 1855 std::vector<gfx::Rect> character_bounds; |
1851 | 1856 |
1852 if (GetTextInputType() == ui::TEXT_INPUT_TYPE_NONE) { | 1857 if (GetTextInputType() == ui::TEXT_INPUT_TYPE_NONE) { |
1853 // Composition information is only available on editable node. | 1858 // Composition information is only available on editable node. |
1854 range = gfx::Range::InvalidRange(); | 1859 range = gfx::Range::InvalidRange(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 #if defined(OS_ANDROID) | 1898 #if defined(OS_ANDROID) |
1894 void RenderWidget::OnRequestTextInputStateUpdate() { | 1899 void RenderWidget::OnRequestTextInputStateUpdate() { |
1895 DCHECK(!ime_event_guard_); | 1900 DCHECK(!ime_event_guard_); |
1896 UpdateSelectionBounds(); | 1901 UpdateSelectionBounds(); |
1897 UpdateTextInputStateInternal(false, true /* reply_to_request */); | 1902 UpdateTextInputStateInternal(false, true /* reply_to_request */); |
1898 } | 1903 } |
1899 #endif | 1904 #endif |
1900 | 1905 |
1901 void RenderWidget::OnRequestCompositionUpdates(bool immediate_request, | 1906 void RenderWidget::OnRequestCompositionUpdates(bool immediate_request, |
1902 bool monitor_updates) { | 1907 bool monitor_updates) { |
| 1908 LOG(ERROR) << "OnRequestCompositionUpdates(): monitor: " |
| 1909 << monitor_composition_info_ |
| 1910 << " -> " |
| 1911 << monitor_updates; |
| 1912 |
1903 monitor_composition_info_ = monitor_updates; | 1913 monitor_composition_info_ = monitor_updates; |
1904 if (!immediate_request) | 1914 if (!immediate_request) |
1905 return; | 1915 return; |
1906 UpdateCompositionInfo(true /* immediate request */); | 1916 UpdateCompositionInfo(true /* immediate request */); |
1907 } | 1917 } |
1908 | 1918 |
1909 void RenderWidget::OnSetDeviceScaleFactor(float device_scale_factor) { | 1919 void RenderWidget::OnSetDeviceScaleFactor(float device_scale_factor) { |
1910 if (device_scale_factor_ == device_scale_factor) | 1920 if (device_scale_factor_ == device_scale_factor) |
1911 return; | 1921 return; |
1912 | 1922 |
(...skipping 428 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 |