Chromium Code Reviews| 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/widget/root_view.h" | 5 #include "views/widget/root_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/drag_drop_types.h" | 9 #include "app/drag_drop_types.h" |
| 10 #include "app/keyboard_codes.h" | 10 #include "app/keyboard_codes.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "gfx/canvas_skia.h" | 13 #include "gfx/canvas_skia.h" |
| 14 #include "views/fill_layout.h" | 14 #include "views/fill_layout.h" |
| 15 #include "views/focus/view_storage.h" | 15 #include "views/focus/view_storage.h" |
| 16 #include "views/widget/widget.h" | 16 #include "views/widget/widget.h" |
| 17 #include "views/window/window.h" | 17 #include "views/window/window.h" |
| 18 | 18 |
| 19 #if defined(TOUCH_UI) | 19 #if defined(TOUCH_UI) |
| 20 #include "views/touchui/gesture_manager.h" | 20 #include "views/touchui/gesture_manager.h" |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 #if defined(OS_LINUX) | 23 #if defined(OS_LINUX) |
| 24 #include "views/widget/widget_gtk.h" | 24 #include "views/widget/widget_gtk.h" |
| 25 #include "views/controls/textfield/native_textfield_views.h" | |
| 25 #endif // defined(OS_LINUX) | 26 #endif // defined(OS_LINUX) |
| 26 | 27 |
| 27 namespace views { | 28 namespace views { |
| 28 | 29 |
| 29 ///////////////////////////////////////////////////////////////////////////// | 30 ///////////////////////////////////////////////////////////////////////////// |
| 30 // | 31 // |
| 31 // A Task to trigger non urgent painting. | 32 // A Task to trigger non urgent painting. |
| 32 // | 33 // |
| 33 ///////////////////////////////////////////////////////////////////////////// | 34 ///////////////////////////////////////////////////////////////////////////// |
| 34 class PaintTask : public Task { | 35 class PaintTask : public Task { |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 610 // We may not have a FocusManager when the window that contains us is being | 611 // We may not have a FocusManager when the window that contains us is being |
| 611 // deleted. Sadly we cannot wait for the window to be destroyed before we | 612 // deleted. Sadly we cannot wait for the window to be destroyed before we |
| 612 // remove the FocusManager (see xp_frame.cc for more info). | 613 // remove the FocusManager (see xp_frame.cc for more info). |
| 613 return NULL; | 614 return NULL; |
| 614 } | 615 } |
| 615 | 616 |
| 616 // Make sure the focused view belongs to this RootView's view hierarchy. | 617 // Make sure the focused view belongs to this RootView's view hierarchy. |
| 617 View* view = focus_manager->GetFocusedView(); | 618 View* view = focus_manager->GetFocusedView(); |
| 618 if (view && (view->GetRootView() == this)) | 619 if (view && (view->GetRootView() == this)) |
| 619 return view; | 620 return view; |
| 620 #if defined(TOUCH_UI) | 621 |
| 621 // hack to deal with two root views in touch | 622 #if defined(OS_LINUX) |
|
rjkroege
2010/12/17 02:01:22
are you sure you don't want to make this TOUCH_UI?
oshima
2010/12/17 07:48:42
Yes. This allow me to text it with linux_views(or
| |
| 622 // should be fixed by eliminating one of them | 623 if (view && NativeTextfieldViews::IsTextfieldViewsEnabled()) { |
| 623 if (view) | 624 // hack to deal with two root views. |
| 625 // should be fixed by eliminating one of them | |
| 624 return view; | 626 return view; |
| 627 } | |
| 625 #endif | 628 #endif |
| 626 return NULL; | 629 return NULL; |
| 627 } | 630 } |
| 628 | 631 |
| 629 FocusSearch* RootView::GetFocusSearch() { | 632 FocusSearch* RootView::GetFocusSearch() { |
| 630 return &focus_search_; | 633 return &focus_search_; |
| 631 } | 634 } |
| 632 | 635 |
| 633 FocusTraversable* RootView::GetFocusTraversableParent() { | 636 FocusTraversable* RootView::GetFocusTraversableParent() { |
| 634 return focus_traversable_parent_; | 637 return focus_traversable_parent_; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 782 #elif defined(OS_LINUX) | 785 #elif defined(OS_LINUX) |
| 783 gfx::NativeView native_view = | 786 gfx::NativeView native_view = |
| 784 static_cast<WidgetGtk*>(GetWidget())->window_contents(); | 787 static_cast<WidgetGtk*>(GetWidget())->window_contents(); |
| 785 if (!native_view) | 788 if (!native_view) |
| 786 return; | 789 return; |
| 787 gdk_window_set_cursor(native_view->window, cursor); | 790 gdk_window_set_cursor(native_view->window, cursor); |
| 788 #endif | 791 #endif |
| 789 } | 792 } |
| 790 | 793 |
| 791 } // namespace views | 794 } // namespace views |
| OLD | NEW |