Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: ui/views/touchui/touch_selection_controller_impl.cc

Issue 286733002: [Refactor] Consolidate the logic for whether a widget can be activated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // Maximum amount that selection handle bar can stick out of client view's 67 // Maximum amount that selection handle bar can stick out of client view's
68 // boundaries. 68 // boundaries.
69 const int kSelectionHandleBarBottomAllowance = 3; 69 const int kSelectionHandleBarBottomAllowance = 3;
70 70
71 // Creates a widget to host SelectionHandleView. 71 // Creates a widget to host SelectionHandleView.
72 views::Widget* CreateTouchSelectionPopupWidget( 72 views::Widget* CreateTouchSelectionPopupWidget(
73 gfx::NativeView context, 73 gfx::NativeView context,
74 views::WidgetDelegate* widget_delegate) { 74 views::WidgetDelegate* widget_delegate) {
75 views::Widget* widget = new views::Widget; 75 views::Widget* widget = new views::Widget;
76 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); 76 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
77 params.can_activate = false;
78 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 77 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
79 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 78 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
80 params.parent = context; 79 params.parent = context;
81 params.delegate = widget_delegate; 80 params.delegate = widget_delegate;
82 widget->Init(params); 81 widget->Init(params);
83 SetShadowType(widget->GetNativeView(), wm::SHADOW_TYPE_NONE); 82 SetShadowType(widget->GetNativeView(), wm::SHADOW_TYPE_NONE);
84 return widget; 83 return widget;
85 } 84 }
86 85
87 gfx::Image* GetHandleImage() { 86 gfx::Image* GetHandleImage() {
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 621
623 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() { 622 bool TouchSelectionControllerImpl::IsSelectionHandle2Visible() {
624 return selection_handle_2_->IsWidgetVisible(); 623 return selection_handle_2_->IsWidgetVisible();
625 } 624 }
626 625
627 bool TouchSelectionControllerImpl::IsCursorHandleVisible() { 626 bool TouchSelectionControllerImpl::IsCursorHandleVisible() {
628 return cursor_handle_->IsWidgetVisible(); 627 return cursor_handle_->IsWidgetVisible();
629 } 628 }
630 629
631 } // namespace views 630 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_delegate.cc ('k') | ui/views/widget/desktop_aura/desktop_native_widget_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698