Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Unified Diff: chrome/browser/ui/touch/frame/touch_browser_frame_view.cc

Issue 8362006: Reland r107720 - Enable the new layer animation framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/touch/frame/touch_browser_frame_view.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
diff --git a/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc b/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
index ed4aea7cbfd6f5e8229815d68f66eaba436be818..e6bd79856648eb8ebd2fe20bbc30f3d9f1c3ee16 100644
--- a/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
+++ b/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
@@ -4,45 +4,9 @@
#include "chrome/browser/ui/touch/frame/touch_browser_frame_view.h"
-#include "chrome/browser/ui/touch/animation/screen_rotation_setter.h"
#include "views/controls/button/image_button.h"
#include "views/desktop/desktop_window_view.h"
-#include "ui/gfx/transform.h"
-
-namespace {
-
-ui::Transform SideToTransform(sensors::ScreenOrientation::Side side,
- const ui::Transform& old_transform,
- const gfx::Size& size) {
- gfx::Point origin;
- gfx::Point bottom_right(size.width(), size.height());
- old_transform.TransformPoint(origin);
- old_transform.TransformPoint(bottom_right);
- int original_width = abs(origin.x() - bottom_right.x());
- int original_height = abs(origin.y() - bottom_right.y());
- ui::Transform to_return;
- switch (side) {
- case sensors::ScreenOrientation::TOP: break;
- case sensors::ScreenOrientation::RIGHT:
- to_return.ConcatRotate(90);
- to_return.ConcatTranslate(original_width, 0);
- break;
- case sensors::ScreenOrientation::LEFT:
- to_return.ConcatRotate(-90);
- to_return.ConcatTranslate(0, original_height);
- break;
- case sensors::ScreenOrientation::BOTTOM:
- to_return.ConcatRotate(180);
- to_return.ConcatTranslate(original_width, original_height);
- break;
- default:
- to_return = old_transform;
- break;
- }
- return to_return;
-}
-
-} // namespace
+#include "ui/gfx/compositor/layer.h"
// static
const char TouchBrowserFrameView::kViewClassName[] =
@@ -55,11 +19,9 @@ TouchBrowserFrameView::TouchBrowserFrameView(BrowserFrame* frame,
BrowserView* browser_view)
: OpaqueBrowserFrameView(frame, browser_view),
initialized_screen_rotation_(false) {
- sensors::Provider::GetInstance()->AddListener(this);
}
TouchBrowserFrameView::~TouchBrowserFrameView() {
- sensors::Provider::GetInstance()->RemoveListener(this);
}
std::string TouchBrowserFrameView::GetClassName() const {
@@ -85,31 +47,3 @@ bool TouchBrowserFrameView::HitTest(const gfx::Point& point) const {
return false;
}
-
-void TouchBrowserFrameView::OnScreenOrientationChanged(
- const sensors::ScreenOrientation& change) {
- // In views desktop mode, then the desktop_window_view will not be NULL and
- // is the view to be rotated.
- views::View* to_rotate =
- views::desktop::DesktopWindowView::desktop_window_view;
-
- if (!to_rotate) {
- // Otherwise, rotate the widget's view.
- views::Widget* widget = GetWidget();
- to_rotate = widget->GetRootView();
- }
-
- if (!initialized_screen_rotation_) {
- to_rotate->SetPaintToLayer(true);
- to_rotate->SetLayerPropertySetter(
- ScreenRotationSetterFactory::Create(to_rotate));
- initialized_screen_rotation_ = true;
- }
-
- const ui::Transform& old_xform = to_rotate->GetTransform();
- const ui::Transform& new_xform = SideToTransform(change.upward,
- old_xform,
- to_rotate->size());
- if (old_xform != new_xform)
- to_rotate->SetTransform(new_xform);
-}
« no previous file with comments | « chrome/browser/ui/touch/frame/touch_browser_frame_view.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698