OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/view.h" | 5 #include "views/view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #ifndef NDEBUG | 8 #ifndef NDEBUG |
9 #include <iostream> | 9 #include <iostream> |
10 #endif | 10 #endif |
11 | 11 |
12 #include "app/drag_drop_types.h" | 12 #include "app/drag_drop_types.h" |
13 #include "app/gfx/canvas.h" | 13 #include "app/gfx/canvas.h" |
14 #include "app/l10n_util.h" | 14 #include "base/i18n/rtl.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
17 #include "base/scoped_handle.h" | 17 #include "base/scoped_handle.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "gfx/path.h" | 19 #include "gfx/path.h" |
20 #include "third_party/skia/include/core/SkShader.h" | 20 #include "third_party/skia/include/core/SkShader.h" |
21 #include "views/background.h" | 21 #include "views/background.h" |
22 #include "views/layout_manager.h" | 22 #include "views/layout_manager.h" |
23 #include "views/views_delegate.h" | 23 #include "views/views_delegate.h" |
24 #include "views/widget/root_view.h" | 24 #include "views/widget/root_view.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 void View::SetLayoutManager(LayoutManager* layout_manager) { | 228 void View::SetLayoutManager(LayoutManager* layout_manager) { |
229 if (layout_manager_.get()) | 229 if (layout_manager_.get()) |
230 layout_manager_->Uninstalled(this); | 230 layout_manager_->Uninstalled(this); |
231 | 231 |
232 layout_manager_.reset(layout_manager); | 232 layout_manager_.reset(layout_manager); |
233 if (layout_manager_.get()) | 233 if (layout_manager_.get()) |
234 layout_manager_->Installed(this); | 234 layout_manager_->Installed(this); |
235 } | 235 } |
236 | 236 |
237 bool View::UILayoutIsRightToLeft() const { | 237 bool View::UILayoutIsRightToLeft() const { |
238 return (ui_mirroring_is_enabled_for_rtl_languages_ && | 238 return (ui_mirroring_is_enabled_for_rtl_languages_ && base::i18n::IsRTL()); |
239 l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT); | |
240 } | 239 } |
241 | 240 |
242 //////////////////////////////////////////////////////////////////////////////// | 241 //////////////////////////////////////////////////////////////////////////////// |
243 // | 242 // |
244 // View - Right-to-left UI layout | 243 // View - Right-to-left UI layout |
245 // | 244 // |
246 //////////////////////////////////////////////////////////////////////////////// | 245 //////////////////////////////////////////////////////////////////////////////// |
247 | 246 |
248 int View::MirroredX() const { | 247 int View::MirroredX() const { |
249 View* parent = GetParent(); | 248 View* parent = GetParent(); |
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 possible_drag = false; | 1460 possible_drag = false; |
1462 start_pt = gfx::Point(); | 1461 start_pt = gfx::Point(); |
1463 } | 1462 } |
1464 | 1463 |
1465 void View::DragInfo::PossibleDrag(const gfx::Point& p) { | 1464 void View::DragInfo::PossibleDrag(const gfx::Point& p) { |
1466 possible_drag = true; | 1465 possible_drag = true; |
1467 start_pt = p; | 1466 start_pt = p; |
1468 } | 1467 } |
1469 | 1468 |
1470 } // namespace | 1469 } // namespace |
OLD | NEW |