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/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 if (web_contents_->GetDelegate() && | 1350 if (web_contents_->GetDelegate() && |
1351 !web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse) && | 1351 !web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse) && |
1352 delegate_.get()) { | 1352 delegate_.get()) { |
1353 delegate_->TakeFocus(reverse); | 1353 delegate_->TakeFocus(reverse); |
1354 } | 1354 } |
1355 } | 1355 } |
1356 | 1356 |
1357 //////////////////////////////////////////////////////////////////////////////// | 1357 //////////////////////////////////////////////////////////////////////////////// |
1358 // WebContentsViewAura, OverscrollControllerDelegate implementation: | 1358 // WebContentsViewAura, OverscrollControllerDelegate implementation: |
1359 | 1359 |
| 1360 gfx::Rect WebContentsViewAura::GetVisibleBounds() const { |
| 1361 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
| 1362 if (!rwhv || !rwhv->IsShowing()) |
| 1363 return gfx::Rect(); |
| 1364 |
| 1365 return rwhv->GetViewBounds(); |
| 1366 } |
| 1367 |
1360 void WebContentsViewAura::OnOverscrollUpdate(float delta_x, float delta_y) { | 1368 void WebContentsViewAura::OnOverscrollUpdate(float delta_x, float delta_y) { |
1361 if (current_overscroll_gesture_ == OVERSCROLL_NONE) | 1369 if (current_overscroll_gesture_ == OVERSCROLL_NONE) |
1362 return; | 1370 return; |
1363 | 1371 |
1364 aura::Window* target = GetWindowToAnimateForOverscroll(); | 1372 aura::Window* target = GetWindowToAnimateForOverscroll(); |
1365 ui::ScopedLayerAnimationSettings settings(target->layer()->GetAnimator()); | 1373 ui::ScopedLayerAnimationSettings settings(target->layer()->GetAnimator()); |
1366 settings.SetPreemptionStrategy(ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET); | 1374 settings.SetPreemptionStrategy(ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET); |
1367 gfx::Vector2d translate = GetTranslationForOverscroll(delta_x, delta_y); | 1375 gfx::Vector2d translate = GetTranslationForOverscroll(delta_x, delta_y); |
1368 gfx::Transform transform; | 1376 gfx::Transform transform; |
1369 | 1377 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 event.location(), | 1643 event.location(), |
1636 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), | 1644 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), |
1637 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 1645 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
1638 if (drag_dest_delegate_) | 1646 if (drag_dest_delegate_) |
1639 drag_dest_delegate_->OnDrop(); | 1647 drag_dest_delegate_->OnDrop(); |
1640 current_drop_data_.reset(); | 1648 current_drop_data_.reset(); |
1641 return current_drag_op_; | 1649 return current_drag_op_; |
1642 } | 1650 } |
1643 | 1651 |
1644 } // namespace content | 1652 } // namespace content |
OLD | NEW |