Chromium Code Reviews| 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_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 | 8 |
| 9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1594 content_view_core_->DidStopFlinging(); | 1594 content_view_core_->DidStopFlinging(); |
| 1595 } | 1595 } |
| 1596 | 1596 |
| 1597 void RenderWidgetHostViewAndroid::SetContentViewCore( | 1597 void RenderWidgetHostViewAndroid::SetContentViewCore( |
| 1598 ContentViewCoreImpl* content_view_core) { | 1598 ContentViewCoreImpl* content_view_core) { |
| 1599 RemoveLayers(); | 1599 RemoveLayers(); |
| 1600 StopObservingRootWindow(); | 1600 StopObservingRootWindow(); |
| 1601 | 1601 |
| 1602 bool resize = false; | 1602 bool resize = false; |
| 1603 if (content_view_core != content_view_core_) { | 1603 if (content_view_core != content_view_core_) { |
| 1604 overscroll_effect_.reset(); | |
| 1604 selection_controller_.reset(); | 1605 selection_controller_.reset(); |
| 1605 ReleaseLocksOnSurface(); | 1606 ReleaseLocksOnSurface(); |
| 1606 resize = true; | 1607 resize = true; |
| 1607 } | 1608 } |
| 1608 | 1609 |
| 1609 content_view_core_ = content_view_core; | 1610 content_view_core_ = content_view_core; |
| 1610 | 1611 |
| 1611 BrowserAccessibilityManager* manager = NULL; | 1612 BrowserAccessibilityManager* manager = NULL; |
| 1612 if (host_) | 1613 if (host_) |
| 1613 manager = host_->GetRootBrowserAccessibilityManager(); | 1614 manager = host_->GetRootBrowserAccessibilityManager(); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 1624 return; | 1625 return; |
| 1625 | 1626 |
| 1626 StartObservingRootWindow(); | 1627 StartObservingRootWindow(); |
| 1627 | 1628 |
| 1628 if (resize) | 1629 if (resize) |
| 1629 WasResized(); | 1630 WasResized(); |
| 1630 | 1631 |
| 1631 if (!selection_controller_) | 1632 if (!selection_controller_) |
| 1632 selection_controller_.reset(new TouchSelectionController(this)); | 1633 selection_controller_.reset(new TouchSelectionController(this)); |
| 1633 | 1634 |
| 1634 if (!content_view_core_) | 1635 if (overscroll_effect_enabled_ && |
| 1635 overscroll_effect_.reset(); | 1636 !overscroll_effect_ && |
| 1636 else if (overscroll_effect_enabled_ && !overscroll_effect_) | 1637 content_view_core_->GetWindowAndroid() && |
|
no sievers
2014/08/25 20:37:36
content_view_core_->GetWindowAndroid() == NULL see
jdduke (slow)
2014/08/25 20:40:04
I figured, so I'll check for a null compositor her
| |
| 1638 content_view_core_->GetWindowAndroid()->GetCompositor()) { | |
| 1637 overscroll_effect_ = CreateOverscrollEffect(content_view_core_); | 1639 overscroll_effect_ = CreateOverscrollEffect(content_view_core_); |
| 1640 } | |
| 1638 } | 1641 } |
| 1639 | 1642 |
| 1640 void RenderWidgetHostViewAndroid::RunAckCallbacks() { | 1643 void RenderWidgetHostViewAndroid::RunAckCallbacks() { |
| 1641 while (!ack_callbacks_.empty()) { | 1644 while (!ack_callbacks_.empty()) { |
| 1642 ack_callbacks_.front().Run(); | 1645 ack_callbacks_.front().Run(); |
| 1643 ack_callbacks_.pop(); | 1646 ack_callbacks_.pop(); |
| 1644 } | 1647 } |
| 1645 } | 1648 } |
| 1646 | 1649 |
| 1647 void RenderWidgetHostViewAndroid::OnGestureEvent( | 1650 void RenderWidgetHostViewAndroid::OnGestureEvent( |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1829 results->orientationAngle = display.RotationAsDegree(); | 1832 results->orientationAngle = display.RotationAsDegree(); |
| 1830 results->orientationType = | 1833 results->orientationType = |
| 1831 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1834 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1832 gfx::DeviceDisplayInfo info; | 1835 gfx::DeviceDisplayInfo info; |
| 1833 results->depth = info.GetBitsPerPixel(); | 1836 results->depth = info.GetBitsPerPixel(); |
| 1834 results->depthPerComponent = info.GetBitsPerComponent(); | 1837 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1835 results->isMonochrome = (results->depthPerComponent == 0); | 1838 results->isMonochrome = (results->depthPerComponent == 0); |
| 1836 } | 1839 } |
| 1837 | 1840 |
| 1838 } // namespace content | 1841 } // namespace content |
| OLD | NEW |