OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/views/touchui/touch_selection_controller_impl.h" | 5 #include "ui/views/touchui/touch_selection_controller_impl.h" |
6 | 6 |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
9 #include "grit/ui_strings.h" | 9 #include "grit/ui_strings.h" |
| 10 #include "ui/aura/window.h" |
10 #include "ui/base/resource/resource_bundle.h" | 11 #include "ui/base/resource/resource_bundle.h" |
11 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
12 #include "ui/gfx/image/image.h" | 13 #include "ui/gfx/image/image.h" |
13 #include "ui/gfx/path.h" | 14 #include "ui/gfx/path.h" |
14 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
15 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
16 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
17 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
18 #include "ui/wm/core/masked_window_targeter.h" | 19 #include "ui/wm/core/masked_window_targeter.h" |
19 #include "ui/wm/core/shadow_types.h" | |
20 #include "ui/wm/core/window_animations.h" | 20 #include "ui/wm/core/window_animations.h" |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // Constants defining the visual attributes of selection handles | 24 // Constants defining the visual attributes of selection handles |
25 const int kSelectionHandleLineWidth = 1; | 25 const int kSelectionHandleLineWidth = 1; |
26 const SkColor kSelectionHandleLineColor = | 26 const SkColor kSelectionHandleLineColor = |
27 SkColorSetRGB(0x42, 0x81, 0xf4); | 27 SkColorSetRGB(0x42, 0x81, 0xf4); |
28 | 28 |
29 // When a handle is dragged, the drag position reported to the client view is | 29 // When a handle is dragged, the drag position reported to the client view is |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 gfx::NativeView context, | 71 gfx::NativeView context, |
72 views::WidgetDelegate* widget_delegate) { | 72 views::WidgetDelegate* widget_delegate) { |
73 views::Widget* widget = new views::Widget; | 73 views::Widget* widget = new views::Widget; |
74 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 74 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
75 params.can_activate = false; | 75 params.can_activate = false; |
76 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 76 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
77 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 77 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
78 params.parent = context; | 78 params.parent = context; |
79 params.delegate = widget_delegate; | 79 params.delegate = widget_delegate; |
80 widget->Init(params); | 80 widget->Init(params); |
81 SetShadowType(widget->GetNativeView(), wm::SHADOW_TYPE_NONE); | 81 widget->SetHasShadow(false); |
82 return widget; | 82 return widget; |
83 } | 83 } |
84 | 84 |
85 gfx::Image* GetHandleImage() { | 85 gfx::Image* GetHandleImage() { |
86 static gfx::Image* handle_image = NULL; | 86 static gfx::Image* handle_image = NULL; |
87 if (!handle_image) { | 87 if (!handle_image) { |
88 handle_image = &ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 88 handle_image = &ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
89 IDR_TEXT_SELECTION_HANDLE); | 89 IDR_TEXT_SELECTION_HANDLE); |
90 } | 90 } |
91 return handle_image; | 91 return handle_image; |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 | 603 |
604 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() { | 604 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() { |
605 return selection_handle_2_->IsWidgetVisible(); | 605 return selection_handle_2_->IsWidgetVisible(); |
606 } | 606 } |
607 | 607 |
608 bool TouchSelectionControllerImpl::IsCursorHandleVisible() { | 608 bool TouchSelectionControllerImpl::IsCursorHandleVisible() { |
609 return cursor_handle_->IsWidgetVisible(); | 609 return cursor_handle_->IsWidgetVisible(); |
610 } | 610 } |
611 | 611 |
612 } // namespace views | 612 } // namespace views |
OLD | NEW |