| 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/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 popup_child_host_view_(NULL), | 625 popup_child_host_view_(NULL), |
| 626 is_loading_(false), | 626 is_loading_(false), |
| 627 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), | 627 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), |
| 628 can_compose_inline_(true), | 628 can_compose_inline_(true), |
| 629 has_composition_text_(false), | 629 has_composition_text_(false), |
| 630 paint_canvas_(NULL), | 630 paint_canvas_(NULL), |
| 631 synthetic_move_sent_(false), | 631 synthetic_move_sent_(false), |
| 632 accelerated_compositing_state_changed_(false), | 632 accelerated_compositing_state_changed_(false), |
| 633 can_lock_compositor_(YES), | 633 can_lock_compositor_(YES), |
| 634 paint_observer_(NULL), | 634 paint_observer_(NULL), |
| 635 accessible_parent_(NULL) { | 635 accessible_parent_(NULL), |
| 636 touch_editing_client_(NULL) { |
| 636 host_->SetView(this); | 637 host_->SetView(this); |
| 637 window_observer_.reset(new WindowObserver(this)); | 638 window_observer_.reset(new WindowObserver(this)); |
| 638 aura::client::SetTooltipText(window_, &tooltip_); | 639 aura::client::SetTooltipText(window_, &tooltip_); |
| 639 aura::client::SetActivationDelegate(window_, this); | 640 aura::client::SetActivationDelegate(window_, this); |
| 640 aura::client::SetActivationChangeObserver(window_, this); | 641 aura::client::SetActivationChangeObserver(window_, this); |
| 641 aura::client::SetFocusChangeObserver(window_, this); | 642 aura::client::SetFocusChangeObserver(window_, this); |
| 642 gfx::Screen::GetScreenFor(window_)->AddObserver(this); | 643 gfx::Screen::GetScreenFor(window_)->AddObserver(this); |
| 643 #if defined(OS_WIN) | 644 #if defined(OS_WIN) |
| 644 transient_observer_.reset(new TransientWindowObserver(this)); | 645 transient_observer_.reset(new TransientWindowObserver(this)); |
| 645 #endif | 646 #endif |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 } | 993 } |
| 993 | 994 |
| 994 void RenderWidgetHostViewAura::TextInputStateChanged( | 995 void RenderWidgetHostViewAura::TextInputStateChanged( |
| 995 const ViewHostMsg_TextInputState_Params& params) { | 996 const ViewHostMsg_TextInputState_Params& params) { |
| 996 if (text_input_type_ != params.type || | 997 if (text_input_type_ != params.type || |
| 997 can_compose_inline_ != params.can_compose_inline) { | 998 can_compose_inline_ != params.can_compose_inline) { |
| 998 text_input_type_ = params.type; | 999 text_input_type_ = params.type; |
| 999 can_compose_inline_ = params.can_compose_inline; | 1000 can_compose_inline_ = params.can_compose_inline; |
| 1000 if (GetInputMethod()) | 1001 if (GetInputMethod()) |
| 1001 GetInputMethod()->OnTextInputTypeChanged(this); | 1002 GetInputMethod()->OnTextInputTypeChanged(this); |
| 1003 if (touch_editing_client_) |
| 1004 touch_editing_client_->OnTextInputTypeChanged(text_input_type_); |
| 1002 } | 1005 } |
| 1003 } | 1006 } |
| 1004 | 1007 |
| 1005 void RenderWidgetHostViewAura::ImeCancelComposition() { | 1008 void RenderWidgetHostViewAura::ImeCancelComposition() { |
| 1006 if (GetInputMethod()) | 1009 if (GetInputMethod()) |
| 1007 GetInputMethod()->CancelComposition(this); | 1010 GetInputMethod()->CancelComposition(this); |
| 1008 has_composition_text_ = false; | 1011 has_composition_text_ = false; |
| 1009 } | 1012 } |
| 1010 | 1013 |
| 1011 void RenderWidgetHostViewAura::ImeCompositionRangeChanged( | 1014 void RenderWidgetHostViewAura::ImeCompositionRangeChanged( |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 const ViewHostMsg_SelectionBounds_Params& params) { | 1110 const ViewHostMsg_SelectionBounds_Params& params) { |
| 1108 if (selection_anchor_rect_ == params.anchor_rect && | 1111 if (selection_anchor_rect_ == params.anchor_rect && |
| 1109 selection_focus_rect_ == params.focus_rect) | 1112 selection_focus_rect_ == params.focus_rect) |
| 1110 return; | 1113 return; |
| 1111 | 1114 |
| 1112 selection_anchor_rect_ = params.anchor_rect; | 1115 selection_anchor_rect_ = params.anchor_rect; |
| 1113 selection_focus_rect_ = params.focus_rect; | 1116 selection_focus_rect_ = params.focus_rect; |
| 1114 | 1117 |
| 1115 if (GetInputMethod()) | 1118 if (GetInputMethod()) |
| 1116 GetInputMethod()->OnCaretBoundsChanged(this); | 1119 GetInputMethod()->OnCaretBoundsChanged(this); |
| 1120 |
| 1121 if (touch_editing_client_) { |
| 1122 touch_editing_client_->OnSelectionOrCursorChanged(selection_anchor_rect_, |
| 1123 selection_focus_rect_); |
| 1124 } |
| 1117 } | 1125 } |
| 1118 | 1126 |
| 1119 void RenderWidgetHostViewAura::ScrollOffsetChanged() { | 1127 void RenderWidgetHostViewAura::ScrollOffsetChanged() { |
| 1120 aura::RootWindow* root = window_->GetRootWindow(); | 1128 aura::RootWindow* root = window_->GetRootWindow(); |
| 1121 if (!root) | 1129 if (!root) |
| 1122 return; | 1130 return; |
| 1123 aura::client::CursorClient* cursor_client = | 1131 aura::client::CursorClient* cursor_client = |
| 1124 aura::client::GetCursorClient(root); | 1132 aura::client::GetCursorClient(root); |
| 1125 if (cursor_client && !cursor_client->IsCursorVisible()) | 1133 if (cursor_client && !cursor_client->IsCursorVisible()) |
| 1126 cursor_client->DisableMouseEvents(); | 1134 cursor_client->DisableMouseEvents(); |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1714 } | 1722 } |
| 1715 | 1723 |
| 1716 void RenderWidgetHostViewAura::GetScreenInfo(WebScreenInfo* results) { | 1724 void RenderWidgetHostViewAura::GetScreenInfo(WebScreenInfo* results) { |
| 1717 GetScreenInfoForWindow(results, window_->GetRootWindow() ? window_ : NULL); | 1725 GetScreenInfoForWindow(results, window_->GetRootWindow() ? window_ : NULL); |
| 1718 } | 1726 } |
| 1719 | 1727 |
| 1720 gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { | 1728 gfx::Rect RenderWidgetHostViewAura::GetBoundsInRootWindow() { |
| 1721 return window_->GetToplevelWindow()->GetBoundsInScreen(); | 1729 return window_->GetToplevelWindow()->GetBoundsInScreen(); |
| 1722 } | 1730 } |
| 1723 | 1731 |
| 1732 void RenderWidgetHostViewAura::GestureEventAck(int gesture_event_type) { |
| 1733 if (touch_editing_client_) |
| 1734 touch_editing_client_->GestureEventAck(gesture_event_type); |
| 1735 } |
| 1736 |
| 1724 void RenderWidgetHostViewAura::ProcessAckedTouchEvent( | 1737 void RenderWidgetHostViewAura::ProcessAckedTouchEvent( |
| 1725 const WebKit::WebTouchEvent& touch_event, InputEventAckState ack_result) { | 1738 const WebKit::WebTouchEvent& touch_event, InputEventAckState ack_result) { |
| 1726 ScopedVector<ui::TouchEvent> events; | 1739 ScopedVector<ui::TouchEvent> events; |
| 1727 if (!MakeUITouchEventsFromWebTouchEvents(touch_event, &events, | 1740 if (!MakeUITouchEventsFromWebTouchEvents(touch_event, &events, |
| 1728 SCREEN_COORDINATES)) | 1741 SCREEN_COORDINATES)) |
| 1729 return; | 1742 return; |
| 1730 | 1743 |
| 1731 aura::RootWindow* root = window_->GetRootWindow(); | 1744 aura::RootWindow* root = window_->GetRootWindow(); |
| 1732 // |root| is NULL during tests. | 1745 // |root| is NULL during tests. |
| 1733 if (!root) | 1746 if (!root) |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2055 const gfx::Point& location) { | 2068 const gfx::Point& location) { |
| 2056 return true; | 2069 return true; |
| 2057 } | 2070 } |
| 2058 | 2071 |
| 2059 bool RenderWidgetHostViewAura::CanFocus() { | 2072 bool RenderWidgetHostViewAura::CanFocus() { |
| 2060 return popup_type_ == WebKit::WebPopupTypeNone; | 2073 return popup_type_ == WebKit::WebPopupTypeNone; |
| 2061 } | 2074 } |
| 2062 | 2075 |
| 2063 void RenderWidgetHostViewAura::OnCaptureLost() { | 2076 void RenderWidgetHostViewAura::OnCaptureLost() { |
| 2064 host_->LostCapture(); | 2077 host_->LostCapture(); |
| 2078 if (touch_editing_client_) |
| 2079 touch_editing_client_->EndTouchEditing(); |
| 2065 } | 2080 } |
| 2066 | 2081 |
| 2067 void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { | 2082 void RenderWidgetHostViewAura::OnPaint(gfx::Canvas* canvas) { |
| 2068 bool is_compositing_active = host_->is_accelerated_compositing_active(); | 2083 bool is_compositing_active = host_->is_accelerated_compositing_active(); |
| 2069 bool has_backing_store = !!host_->GetBackingStore(false); | 2084 bool has_backing_store = !!host_->GetBackingStore(false); |
| 2070 if (is_compositing_active && current_dib_) { | 2085 if (is_compositing_active && current_dib_) { |
| 2071 const gfx::Size window_size = window_->bounds().size(); | 2086 const gfx::Size window_size = window_->bounds().size(); |
| 2072 const gfx::Size& frame_size = last_swapped_surface_size_; | 2087 const gfx::Size& frame_size = last_swapped_surface_size_; |
| 2073 | 2088 |
| 2074 SkBitmap bitmap; | 2089 SkBitmap bitmap; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2174 return scoped_refptr<ui::Texture>( | 2189 return scoped_refptr<ui::Texture>( |
| 2175 factory->CreateOwnedTexture( | 2190 factory->CreateOwnedTexture( |
| 2176 current_surface_->size(), current_device_scale_factor_, texture_id)); | 2191 current_surface_->size(), current_device_scale_factor_, texture_id)); |
| 2177 } | 2192 } |
| 2178 | 2193 |
| 2179 //////////////////////////////////////////////////////////////////////////////// | 2194 //////////////////////////////////////////////////////////////////////////////// |
| 2180 // RenderWidgetHostViewAura, ui::EventHandler implementation: | 2195 // RenderWidgetHostViewAura, ui::EventHandler implementation: |
| 2181 | 2196 |
| 2182 void RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) { | 2197 void RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) { |
| 2183 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnKeyEvent"); | 2198 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnKeyEvent"); |
| 2199 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) |
| 2200 return; |
| 2201 |
| 2184 if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab()) { | 2202 if (popup_child_host_view_ && popup_child_host_view_->NeedsInputGrab()) { |
| 2185 popup_child_host_view_->OnKeyEvent(event); | 2203 popup_child_host_view_->OnKeyEvent(event); |
| 2186 if (event->handled()) | 2204 if (event->handled()) |
| 2187 return; | 2205 return; |
| 2188 } | 2206 } |
| 2189 | 2207 |
| 2190 // We need to handle the Escape key for Pepper Flash. | 2208 // We need to handle the Escape key for Pepper Flash. |
| 2191 if (is_fullscreen_ && event->key_code() == ui::VKEY_ESCAPE) { | 2209 if (is_fullscreen_ && event->key_code() == ui::VKEY_ESCAPE) { |
| 2192 // Focus the window we were created from. | 2210 // Focus the window we were created from. |
| 2193 if (host_tracker_.get() && !host_tracker_->windows().empty()) { | 2211 if (host_tracker_.get() && !host_tracker_->windows().empty()) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 2223 NativeWebKeyboardEvent webkit_event(event); | 2241 NativeWebKeyboardEvent webkit_event(event); |
| 2224 host_->ForwardKeyboardEvent(webkit_event); | 2242 host_->ForwardKeyboardEvent(webkit_event); |
| 2225 } | 2243 } |
| 2226 } | 2244 } |
| 2227 event->SetHandled(); | 2245 event->SetHandled(); |
| 2228 } | 2246 } |
| 2229 | 2247 |
| 2230 void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) { | 2248 void RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) { |
| 2231 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnMouseEvent"); | 2249 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnMouseEvent"); |
| 2232 | 2250 |
| 2251 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) |
| 2252 return; |
| 2253 |
| 2233 if (mouse_locked_) { | 2254 if (mouse_locked_) { |
| 2234 // Hide the cursor if someone else has shown it. | 2255 // Hide the cursor if someone else has shown it. |
| 2235 aura::client::CursorClient* cursor_client = | 2256 aura::client::CursorClient* cursor_client = |
| 2236 aura::client::GetCursorClient(window_->GetRootWindow()); | 2257 aura::client::GetCursorClient(window_->GetRootWindow()); |
| 2237 if (cursor_client && cursor_client->IsCursorVisible()) | 2258 if (cursor_client && cursor_client->IsCursorVisible()) |
| 2238 cursor_client->DisableMouseEvents(); | 2259 cursor_client->DisableMouseEvents(); |
| 2239 | 2260 |
| 2240 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event); | 2261 WebKit::WebMouseEvent mouse_event = MakeWebMouseEvent(event); |
| 2241 gfx::Point center(gfx::Rect(window_->bounds().size()).CenterPoint()); | 2262 gfx::Point center(gfx::Rect(window_->bounds().size()).CenterPoint()); |
| 2242 | 2263 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2327 if (!is_fullscreen_ && window_->parent()->delegate() && | 2348 if (!is_fullscreen_ && window_->parent()->delegate() && |
| 2328 !(event->flags() & ui::EF_FROM_TOUCH)) | 2349 !(event->flags() & ui::EF_FROM_TOUCH)) |
| 2329 window_->parent()->delegate()->OnMouseEvent(event); | 2350 window_->parent()->delegate()->OnMouseEvent(event); |
| 2330 | 2351 |
| 2331 if (!IsXButtonUpEvent(event)) | 2352 if (!IsXButtonUpEvent(event)) |
| 2332 event->SetHandled(); | 2353 event->SetHandled(); |
| 2333 } | 2354 } |
| 2334 | 2355 |
| 2335 void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) { | 2356 void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) { |
| 2336 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnScrollEvent"); | 2357 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnScrollEvent"); |
| 2358 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) |
| 2359 return; |
| 2360 |
| 2337 if (event->type() == ui::ET_SCROLL) { | 2361 if (event->type() == ui::ET_SCROLL) { |
| 2338 if (event->finger_count() != 2) | 2362 if (event->finger_count() != 2) |
| 2339 return; | 2363 return; |
| 2340 WebKit::WebGestureEvent gesture_event = | 2364 WebKit::WebGestureEvent gesture_event = |
| 2341 MakeWebGestureEventFlingCancel(); | 2365 MakeWebGestureEventFlingCancel(); |
| 2342 host_->ForwardGestureEvent(gesture_event); | 2366 host_->ForwardGestureEvent(gesture_event); |
| 2343 WebKit::WebMouseWheelEvent mouse_wheel_event = | 2367 WebKit::WebMouseWheelEvent mouse_wheel_event = |
| 2344 MakeWebMouseWheelEvent(static_cast<ui::ScrollEvent*>(event)); | 2368 MakeWebMouseWheelEvent(static_cast<ui::ScrollEvent*>(event)); |
| 2345 host_->ForwardWheelEvent(mouse_wheel_event); | 2369 host_->ForwardWheelEvent(mouse_wheel_event); |
| 2346 RecordAction(UserMetricsAction("TrackpadScroll")); | 2370 RecordAction(UserMetricsAction("TrackpadScroll")); |
| 2347 } else if (event->type() == ui::ET_SCROLL_FLING_START || | 2371 } else if (event->type() == ui::ET_SCROLL_FLING_START || |
| 2348 event->type() == ui::ET_SCROLL_FLING_CANCEL) { | 2372 event->type() == ui::ET_SCROLL_FLING_CANCEL) { |
| 2349 WebKit::WebGestureEvent gesture_event = | 2373 WebKit::WebGestureEvent gesture_event = |
| 2350 MakeWebGestureEvent(static_cast<ui::ScrollEvent*>(event)); | 2374 MakeWebGestureEvent(static_cast<ui::ScrollEvent*>(event)); |
| 2351 host_->ForwardGestureEvent(gesture_event); | 2375 host_->ForwardGestureEvent(gesture_event); |
| 2352 if (event->type() == ui::ET_SCROLL_FLING_START) | 2376 if (event->type() == ui::ET_SCROLL_FLING_START) |
| 2353 RecordAction(UserMetricsAction("TrackpadScrollFling")); | 2377 RecordAction(UserMetricsAction("TrackpadScrollFling")); |
| 2354 } | 2378 } |
| 2355 | 2379 |
| 2356 event->SetHandled(); | 2380 event->SetHandled(); |
| 2357 } | 2381 } |
| 2358 | 2382 |
| 2359 void RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* event) { | 2383 void RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* event) { |
| 2360 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnTouchEvent"); | 2384 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnTouchEvent"); |
| 2385 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) |
| 2386 return; |
| 2387 |
| 2361 // Update the touch event first. | 2388 // Update the touch event first. |
| 2362 WebKit::WebTouchPoint* point = UpdateWebTouchEventFromUIEvent(*event, | 2389 WebKit::WebTouchPoint* point = UpdateWebTouchEventFromUIEvent(*event, |
| 2363 &touch_event_); | 2390 &touch_event_); |
| 2364 | 2391 |
| 2365 // Forward the touch event only if a touch point was updated, and there's a | 2392 // Forward the touch event only if a touch point was updated, and there's a |
| 2366 // touch-event handler in the page, and no other touch-event is in the queue. | 2393 // touch-event handler in the page, and no other touch-event is in the queue. |
| 2367 // It is important to always consume the event if there is a touch-event | 2394 // It is important to always consume the event if there is a touch-event |
| 2368 // handler in the page, or some touch-event is already in the queue, even if | 2395 // handler in the page, or some touch-event is already in the queue, even if |
| 2369 // no point has been updated, to make sure that this event does not get | 2396 // no point has been updated, to make sure that this event does not get |
| 2370 // processed by the gesture recognizer before the events in the queue. | 2397 // processed by the gesture recognizer before the events in the queue. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2381 void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) { | 2408 void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) { |
| 2382 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnGestureEvent"); | 2409 TRACE_EVENT0("browser", "RenderWidgetHostViewAura::OnGestureEvent"); |
| 2383 // Pinch gestures are currently disabled by default. See crbug.com/128477. | 2410 // Pinch gestures are currently disabled by default. See crbug.com/128477. |
| 2384 if ((event->type() == ui::ET_GESTURE_PINCH_BEGIN || | 2411 if ((event->type() == ui::ET_GESTURE_PINCH_BEGIN || |
| 2385 event->type() == ui::ET_GESTURE_PINCH_UPDATE || | 2412 event->type() == ui::ET_GESTURE_PINCH_UPDATE || |
| 2386 event->type() == ui::ET_GESTURE_PINCH_END) && !ShouldSendPinchGesture()) { | 2413 event->type() == ui::ET_GESTURE_PINCH_END) && !ShouldSendPinchGesture()) { |
| 2387 event->SetHandled(); | 2414 event->SetHandled(); |
| 2388 return; | 2415 return; |
| 2389 } | 2416 } |
| 2390 | 2417 |
| 2418 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) |
| 2419 return; |
| 2420 |
| 2391 RenderViewHostDelegate* delegate = NULL; | 2421 RenderViewHostDelegate* delegate = NULL; |
| 2392 if (popup_type_ == WebKit::WebPopupTypeNone && !is_fullscreen_) | 2422 if (popup_type_ == WebKit::WebPopupTypeNone && !is_fullscreen_) |
| 2393 delegate = RenderViewHost::From(host_)->GetDelegate(); | 2423 delegate = RenderViewHost::From(host_)->GetDelegate(); |
| 2394 | 2424 |
| 2395 if (delegate && event->type() == ui::ET_GESTURE_BEGIN && | 2425 if (delegate && event->type() == ui::ET_GESTURE_BEGIN && |
| 2396 event->details().touch_points() == 1) { | 2426 event->details().touch_points() == 1) { |
| 2397 delegate->HandleGestureBegin(); | 2427 delegate->HandleGestureBegin(); |
| 2398 } | 2428 } |
| 2399 | 2429 |
| 2400 WebKit::WebGestureEvent gesture = MakeWebGestureEvent(event); | 2430 WebKit::WebGestureEvent gesture = MakeWebGestureEvent(event); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2498 // window if we lose the focus to a window on another display. | 2528 // window if we lose the focus to a window on another display. |
| 2499 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_); | 2529 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_); |
| 2500 bool focusing_other_display = | 2530 bool focusing_other_display = |
| 2501 gained_focus && screen->GetNumDisplays() > 1 && | 2531 gained_focus && screen->GetNumDisplays() > 1 && |
| 2502 (screen->GetDisplayNearestWindow(window_).id() != | 2532 (screen->GetDisplayNearestWindow(window_).id() != |
| 2503 screen->GetDisplayNearestWindow(gained_focus).id()); | 2533 screen->GetDisplayNearestWindow(gained_focus).id()); |
| 2504 if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) { | 2534 if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) { |
| 2505 in_shutdown_ = true; | 2535 in_shutdown_ = true; |
| 2506 host_->Shutdown(); | 2536 host_->Shutdown(); |
| 2507 } | 2537 } |
| 2538 if (touch_editing_client_) |
| 2539 touch_editing_client_->EndTouchEditing(); |
| 2508 } | 2540 } |
| 2509 } | 2541 } |
| 2510 | 2542 |
| 2511 //////////////////////////////////////////////////////////////////////////////// | 2543 //////////////////////////////////////////////////////////////////////////////// |
| 2512 // RenderWidgetHostViewAura, aura::RootWindowObserver implementation: | 2544 // RenderWidgetHostViewAura, aura::RootWindowObserver implementation: |
| 2513 | 2545 |
| 2514 void RenderWidgetHostViewAura::OnRootWindowMoved(const aura::RootWindow* root, | 2546 void RenderWidgetHostViewAura::OnRootWindowMoved(const aura::RootWindow* root, |
| 2515 const gfx::Point& new_origin) { | 2547 const gfx::Point& new_origin) { |
| 2516 UpdateScreenInfo(window_); | 2548 UpdateScreenInfo(window_); |
| 2517 } | 2549 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2636 host_->CompositingSurfaceUpdated(); | 2668 host_->CompositingSurfaceUpdated(); |
| 2637 host_->ScheduleComposite(); | 2669 host_->ScheduleComposite(); |
| 2638 } | 2670 } |
| 2639 | 2671 |
| 2640 //////////////////////////////////////////////////////////////////////////////// | 2672 //////////////////////////////////////////////////////////////////////////////// |
| 2641 // RenderWidgetHostViewAura, private: | 2673 // RenderWidgetHostViewAura, private: |
| 2642 | 2674 |
| 2643 RenderWidgetHostViewAura::~RenderWidgetHostViewAura() { | 2675 RenderWidgetHostViewAura::~RenderWidgetHostViewAura() { |
| 2644 if (paint_observer_) | 2676 if (paint_observer_) |
| 2645 paint_observer_->OnViewDestroyed(); | 2677 paint_observer_->OnViewDestroyed(); |
| 2678 if (touch_editing_client_) |
| 2679 touch_editing_client_->OnViewDestroyed(); |
| 2646 if (!shared_surface_handle_.is_null()) { | 2680 if (!shared_surface_handle_.is_null()) { |
| 2647 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | 2681 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
| 2648 factory->DestroySharedSurfaceHandle(shared_surface_handle_); | 2682 factory->DestroySharedSurfaceHandle(shared_surface_handle_); |
| 2649 factory->RemoveObserver(this); | 2683 factory->RemoveObserver(this); |
| 2650 } | 2684 } |
| 2651 window_observer_.reset(); | 2685 window_observer_.reset(); |
| 2652 #if defined(OS_WIN) | 2686 #if defined(OS_WIN) |
| 2653 transient_observer_.reset(); | 2687 transient_observer_.reset(); |
| 2654 #endif | 2688 #endif |
| 2655 if (window_->GetRootWindow()) | 2689 if (window_->GetRootWindow()) |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2848 RenderWidgetHost* widget) { | 2882 RenderWidgetHost* widget) { |
| 2849 return new RenderWidgetHostViewAura(widget); | 2883 return new RenderWidgetHostViewAura(widget); |
| 2850 } | 2884 } |
| 2851 | 2885 |
| 2852 // static | 2886 // static |
| 2853 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 2887 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 2854 GetScreenInfoForWindow(results, NULL); | 2888 GetScreenInfoForWindow(results, NULL); |
| 2855 } | 2889 } |
| 2856 | 2890 |
| 2857 } // namespace content | 2891 } // namespace content |
| OLD | NEW |