| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/touch/frame/touch_browser_frame_view.h" | 5 #include "chrome/browser/ui/touch/frame/touch_browser_frame_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/touch/animation/screen_rotation_setter.h" | 7 #include "chrome/browser/ui/touch/animation/screen_rotation_setter.h" |
| 8 #include "chrome/browser/ui/touch/keyboard/keyboard_manager.h" | 8 #include "chrome/browser/ui/touch/keyboard/keyboard_manager.h" |
| 9 #include "views/controls/button/image_button.h" | 9 #include "views/controls/button/image_button.h" |
| 10 #include "views/desktop/desktop_window_view.h" | 10 #include "views/desktop/desktop_window_view.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 to_rotate = widget->GetRootView(); | 102 to_rotate = widget->GetRootView(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 if (!initialized_screen_rotation_) { | 105 if (!initialized_screen_rotation_) { |
| 106 to_rotate->SetPaintToLayer(true); | 106 to_rotate->SetPaintToLayer(true); |
| 107 to_rotate->SetLayerPropertySetter( | 107 to_rotate->SetLayerPropertySetter( |
| 108 ScreenRotationSetterFactory::Create(to_rotate)); | 108 ScreenRotationSetterFactory::Create(to_rotate)); |
| 109 initialized_screen_rotation_ = true; | 109 initialized_screen_rotation_ = true; |
| 110 } | 110 } |
| 111 | 111 |
| 112 ui::Transform xform = SideToTransform(change.upward, | 112 const ui::Transform& old_xform = to_rotate->GetTransform(); |
| 113 to_rotate->GetTransform(), | 113 const ui::Transform& new_xform = SideToTransform(change.upward, |
| 114 to_rotate->size()); | 114 old_xform, |
| 115 | 115 to_rotate->size()); |
| 116 to_rotate->SetTransform(xform); | 116 if (old_xform != new_xform) |
| 117 to_rotate->SetTransform(new_xform); |
| 117 } | 118 } |
| 118 | |
| OLD | NEW |