| 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 #ifndef UI_VIEWS_VIEW_H_ | 5 #ifndef UI_VIEWS_VIEW_H_ |
| 6 #define UI_VIEWS_VIEW_H_ | 6 #define UI_VIEWS_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 // EnableCanvasFlippingForRTLUI(). | 478 // EnableCanvasFlippingForRTLUI(). |
| 479 bool FlipCanvasOnPaintForRTLUI() const { | 479 bool FlipCanvasOnPaintForRTLUI() const { |
| 480 return flip_canvas_on_paint_for_rtl_ui_ ? base::i18n::IsRTL() : false; | 480 return flip_canvas_on_paint_for_rtl_ui_ ? base::i18n::IsRTL() : false; |
| 481 } | 481 } |
| 482 | 482 |
| 483 // Enables or disables flipping of the gfx::Canvas during View::Paint(). | 483 // Enables or disables flipping of the gfx::Canvas during View::Paint(). |
| 484 // Note that if canvas flipping is enabled, the canvas will be flipped only | 484 // Note that if canvas flipping is enabled, the canvas will be flipped only |
| 485 // if the UI layout is right-to-left; that is, the canvas will be flipped | 485 // if the UI layout is right-to-left; that is, the canvas will be flipped |
| 486 // only if base::i18n::IsRTL() returns true. | 486 // only if base::i18n::IsRTL() returns true. |
| 487 // | 487 // |
| 488 // Enabling canvas flipping is useful for leaf views that draw a bitmap that | 488 // Enabling canvas flipping is useful for leaf views that draw an image that |
| 489 // needs to be flipped horizontally when the UI layout is right-to-left | 489 // needs to be flipped horizontally when the UI layout is right-to-left |
| 490 // (views::Button, for example). This method is helpful for such classes | 490 // (views::Button, for example). This method is helpful for such classes |
| 491 // because their drawing logic stays the same and they can become agnostic to | 491 // because their drawing logic stays the same and they can become agnostic to |
| 492 // the UI directionality. | 492 // the UI directionality. |
| 493 void EnableCanvasFlippingForRTLUI(bool enable) { | 493 void EnableCanvasFlippingForRTLUI(bool enable) { |
| 494 flip_canvas_on_paint_for_rtl_ui_ = enable; | 494 flip_canvas_on_paint_for_rtl_ui_ = enable; |
| 495 } | 495 } |
| 496 | 496 |
| 497 // Accelerated painting ------------------------------------------------------ | 497 // Accelerated painting ------------------------------------------------------ |
| 498 | 498 |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1464 base::win::ScopedComPtr<NativeViewAccessibilityWin> | 1464 base::win::ScopedComPtr<NativeViewAccessibilityWin> |
| 1465 native_view_accessibility_win_; | 1465 native_view_accessibility_win_; |
| 1466 #endif | 1466 #endif |
| 1467 | 1467 |
| 1468 DISALLOW_COPY_AND_ASSIGN(View); | 1468 DISALLOW_COPY_AND_ASSIGN(View); |
| 1469 }; | 1469 }; |
| 1470 | 1470 |
| 1471 } // namespace views | 1471 } // namespace views |
| 1472 | 1472 |
| 1473 #endif // UI_VIEWS_VIEW_H_ | 1473 #endif // UI_VIEWS_VIEW_H_ |
| OLD | NEW |