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 2287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2298 image.getSkBitmap(), imageOffset, | 2298 image.getSkBitmap(), imageOffset, |
2299 possible_drag_event_info_)); | 2299 possible_drag_event_info_)); |
2300 } | 2300 } |
2301 | 2301 |
2302 blink::WebWidget* RenderWidget::GetWebWidget() const { | 2302 blink::WebWidget* RenderWidget::GetWebWidget() const { |
2303 return webwidget_internal_; | 2303 return webwidget_internal_; |
2304 } | 2304 } |
2305 | 2305 |
2306 blink::WebInputMethodController* RenderWidget::GetInputMethodController() | 2306 blink::WebInputMethodController* RenderWidget::GetInputMethodController() |
2307 const { | 2307 const { |
2308 // TODO(ekaramad): Remove this CHECK when GetWebWidget() is | 2308 // TODO(ekaramad): Remove this condition when GetWebWidget() is always a |
2309 // always a WebFrameWidget. | 2309 // WebFrameWidget, or find a better way to obtain the WebFrameWidget for |
2310 CHECK(GetWebWidget()->isWebFrameWidget()); | 2310 // this RenderWidget. |
2311 if (!GetWebWidget()->isWebFrameWidget()) { | |
2312 // It is possible to get here if this is a top-level RenderWidget and an IME | |
2313 // IPC is received during page navigation, in which case GetWebWidget() | |
2314 // yields a WebViewImpl instead of a WebFrameWiget. | |
2315 return nullptr; | |
EhsanK
2016/11/24 01:21:39
I should also note that this method can return nul
| |
2316 } | |
2311 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) | 2317 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) |
2312 ->getActiveWebInputMethodController(); | 2318 ->getActiveWebInputMethodController(); |
2313 } | 2319 } |
2314 | 2320 |
2315 } // namespace content | 2321 } // namespace content |
OLD | NEW |