summaryrefslogtreecommitdiffstats
path: root/views/view_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Nix GetFocusManagerForNativeView|Window.msw@chromium.org2011-08-021-4/+2
| | | | | | | | | | | | Use Widget|View::GetFocusManager instead. Use Widget::Get[TopLevel]WidgetForNativeView|Window as necessary. BUG=88718 TEST=none Review URL: http://codereview.chromium.org/7532015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95111 0039d316-1c4b-4281-b951-d872f2087c98
* Shell of implementation for embedded windows. At this point this issky@chromium.org2011-07-291-2/+2
| | | | | | | | | | | | | | | | | just a proof of concept. Next step is going to be pulling code from the window manager into this. Desktop will likely be renamed to WindowManager. At this point just make sure you think I'm not going off into the weeds. BUG=none TEST=none R=derat@chromium.org Review URL: http://codereview.chromium.org/7534002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94733 0039d316-1c4b-4281-b951-d872f2087c98
* First pass for eliminating double paintingpkotwicz@chromium.org2011-07-291-1/+107
| | | | | | | | | | | | | | | | | | | | | | | A simple 3D CSS benchmark shows a 20% improvement in framerate on T25 hardware: an increase from about 30 fps to 36 fps. This is a first pass to getting rid of double painting by introducing a hole in layers Currently a layer which wants its parent not to paint under it will call SetParentLayerHoley There are a number of questions in terms of implementation: 1) We are doing this with layers. We are currently setting all layers to be holey if the touch_ui flag is enabled. Another option is to merge the holey functionality into regular layers. (Get rid of the holey layer subclass) 2) We are always generating vertices matrix, even in the ui::Layer case, is this ok? 3) We are wasting video memory. We are still uploading a full bitmap. I wasn't able to find a function call which would be able to efficiently slice the bigger bitmap, notably changing the origin of where the painting starts (texture upload) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91848 0039d316-1c4b-4281-b951-d872f2087c98 BUG= TEST= Review URL: http://codereview.chromium.org/7330025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94677 0039d316-1c4b-4281-b951-d872f2087c98
* Create views.dll / libviews.sodarin@chromium.org2011-07-281-1/+1
| | | | | | | R=sky@chromium.org,rvargas@chromium.org Review URL: http://codereview.chromium.org/7493017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94428 0039d316-1c4b-4281-b951-d872f2087c98
* Update Texture/Layer SetCanvas, callsites, and comments.msw@chromium.org2011-07-271-5/+6
| | | | | | | | | | | Fix TestTexture and ViewLayerTest compile. BUG=90548 TEST=none Review URL: http://codereview.chromium.org/7470030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94241 0039d316-1c4b-4281-b951-d872f2087c98
* Removing unused NativeButton codesaintlou@chromium.org2011-07-261-40/+2
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/7493004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94114 0039d316-1c4b-4281-b951-d872f2087c98
* views: Add unittests for View::GetViewsWithGroup() method.tfarina@chromium.org2011-07-131-0/+14
| | | | | | | | | | | | | Also, rename it to GetViewsInGroup(). BUG=72040 TEST=views_unittests --gtest_filter=ViewTest.GetViewByID R=ben@chromium.org,sky@chromium.org Review URL: http://codereview.chromium.org/7328031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92430 0039d316-1c4b-4281-b951-d872f2087c98
* views: Some views tests should use EXPECT_* rather than ASSERT_*.tfarina@chromium.org2011-07-081-32/+32
| | | | | | | | | | | | | | | | ASSERT should be used in cases where we are going to rely in pointer being not NULL in the next test or an array having determinate numbers of elements because we are going to access an element of it in the next step. But these aren't the cases here. BUG=None TEST=views_unittests R=sky@chromium.org Review URL: http://codereview.chromium.org/7330021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91900 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes crash in views desktop. The problem wassky@chromium.org2011-07-081-4/+4
| | | | | | | | | | | | | CreateRenderWidgetHostView would delete the old RenderWidgetHostView. Also fixes compile error in views_unittests. BUG=none TEST=none R=ben@chromium.org Review URL: http://codereview.chromium.org/7329027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91888 0039d316-1c4b-4281-b951-d872f2087c98
* Use SkMatrix44 for the underlying implementation of ui::Transformbacker@chromium.org2011-07-081-22/+40
| | | | | | | | | | BUG= TEST=ui_unittest Review URL: http://codereview.chromium.org/7044062 Patch from Ian Vollick <vollick@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91855 0039d316-1c4b-4281-b951-d872f2087c98
* Push (not pull) window geometry for the compositor.backer@chromium.org2011-07-061-0/+1
| | | | | | | | | | | The previous implementation used to poll the environment for the window size every drawing cycle. On Linux this is an expensive operation because it requires a round trip to the X server. This CL pushes window size change to the compositor. BUG=none TEST=none Review URL: http://codereview.chromium.org/7212028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91572 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed issue with layers being deleted upon SetVisible with an argument of truebacker@chromium.org2011-07-061-0/+19
| | | | | | | | | | | | | | | Steps for Repro. From a touch build 1) Goto google.com 2) Type into text field 3) Typed text does not show up BUG=87840 TEST=views_unittest (ToggleVisibilityWithLayer) Review URL: http://codereview.chromium.org/7273067 Patch from Peter Kotwicz <pkotwicz@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91563 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes bug where transform wasn't reset on layer correctly.sky@chromium.org2011-07-011-0/+20
| | | | | | | | | | BUG=none TEST=covered by unit test. R=wjmaclean@chromium.org Review URL: http://codereview.chromium.org/7210048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91317 0039d316-1c4b-4281-b951-d872f2087c98
* Gets compositor working for embedded widgets.sky@chromium.org2011-07-011-0/+49
| | | | | | | | | | BUG=none TEST=none R=ben@chromium.org Review URL: http://codereview.chromium.org/7280002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91312 0039d316-1c4b-4281-b951-d872f2087c98
* Views views_unittests Views and NativeTextFields tests leakdhollowa@chromium.org2011-06-301-25/+25
| | | | | | | | | | | Fixes leaks in ViewTest.* and NativeTextFieldViewsTest.*. BUG=87904 TEST=tools/valgrind/chrome_tests.sh views --gtest_filter=ViewTest.*:NativeTextFieldViewsTest.* Review URL: http://codereview.chromium.org/7280008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91064 0039d316-1c4b-4281-b951-d872f2087c98
* Convert the rect to the widget's coordinates correctly.sadrul@chromium.org2011-06-291-0/+48
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/7276053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90952 0039d316-1c4b-4281-b951-d872f2087c98
* views: Allocate View on the stack in the OnBoundsChanged unittest.tfarina@chromium.org2011-06-281-27/+18
| | | | | | | | | | | BUG=None TEST=views_unittest --gtest_filter=ViewTest.OnBoundsChanged R=sky@chromium.org Review URL: http://codereview.chromium.org/7274012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90781 0039d316-1c4b-4281-b951-d872f2087c98
* Remove ifdef's for touchui stuff from events code.sadrul@chromium.org2011-06-281-18/+7
| | | | | | | | | | | Also, make sure the touch_pressed_handler_ is the view being removed before resetting it to NULL. BUG=none TEST=things compile and existing tests continue to pass Review URL: http://codereview.chromium.org/7276002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90762 0039d316-1c4b-4281-b951-d872f2087c98
* Makes it so that if the size of a view with a layer changes or on creatingsky@chromium.org2011-06-281-1/+28
| | | | | | | | | | | | | | | the layer we force the complete bounds to be painted. This way the Compositors don't have to worry about partial update of a size they've never seen. This matches old logic I removed thinking it was no longer needed. BUG=none TEST=none R=ben@chromium.org Review URL: http://codereview.chromium.org/7272013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90711 0039d316-1c4b-4281-b951-d872f2087c98
* views: Add unittests for View::GetViewByID() method.tfarina@chromium.org2011-06-271-0/+38
| | | | | | | | | | | BUG=None TEST=views_unittests --gtest_filter=ViewTest.GetViewByID R=sky@chromium.org Review URL: http://codereview.chromium.org/7272003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90679 0039d316-1c4b-4281-b951-d872f2087c98
* Moves acclerated painting related fields from View to LayerHelper.sky@chromium.org2011-06-271-0/+16
| | | | | | | | | | BUG=none TEST=none R=ben@chromium.org Review URL: http://codereview.chromium.org/7242025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90589 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes bug where layer bounds weren't correctly set when views was setsky@chromium.org2011-06-241-0/+24
| | | | | | | | | | | | in a couple of cases. BUG=none TEST=none R=ben@chromium.org Review URL: http://codereview.chromium.org/7247020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90333 0039d316-1c4b-4281-b951-d872f2087c98
* Adds the ability to animate transforms/bounds to View.sky@chromium.org2011-06-231-1/+73
| | | | | | | | | | BUG=none TEST=none R=ben@chromium.org,wjmaclean@chromium.org Review URL: http://codereview.chromium.org/7242005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90254 0039d316-1c4b-4281-b951-d872f2087c98
* Updated remaining button to text button. Reverted the interposedsaintlou@chromium.org2011-06-231-10/+10
| | | | | | | | | | | class NativeButtonBase which is no longer needed. BUG=none TEST=none Review URL: http://codereview.chromium.org/7218035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90220 0039d316-1c4b-4281-b951-d872f2087c98
* Fix building views_unittests.sadrul@chromium.org2011-06-221-0/+1
| | | | | | TBR=sky@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89954 0039d316-1c4b-4281-b951-d872f2087c98
* Reland "views: Refactor AddRemoveNotifications unittest."tfarina@chromium.org2011-06-221-102/+145
| | | | | | | | | | | | | | | | | | This removes the second definition of the ObserverView class, that was added by the merge conflict. This reverts commit 2a16ddfe7e09bec206daf6bdab3ef6d1a573dbfd. BUG=None TEST=views_unittests --gtest_filter=ViewTest.ViewHierarchyChanged TBR=sky@chromium.org Original Review URL: http://codereview.chromium.org/7184031 Review URL: http://codereview.chromium.org/7206060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89947 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 89910 - views: Refactor AddRemoveNotifications unittest.rvargas@google.com2011-06-211-271/+102
| | | | | | | | | | | | | | | | | | | - Extract the code from TestView class. - Move the code into a new class called ObserverView. - Rename the test case from AddRemoveNotifications to ViewHierarchyChanged. - Use ObserverView class instead of TestView. - Improve the checks, make them more clearer. - Use EXPECT_TRUE instead of EXPECT_EQ(true, something); same thing for the false case. BUG=None TEST=views_unittests --gtest_filter=ViewTest.ViewHierarchyChanged Review URL: http://codereview.chromium.org/7184031 TBR=tfarina@chromium.org Review URL: http://codereview.chromium.org/7218025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89913 0039d316-1c4b-4281-b951-d872f2087c98
* views: Refactor AddRemoveNotifications unittest.tfarina@chromium.org2011-06-211-102/+271
| | | | | | | | | | | | | | | | - Extract the code from TestView class. - Move the code into a new class called ObserverView. - Rename the test case from AddRemoveNotifications to ViewHierarchyChanged. - Use ObserverView class instead of TestView. - Improve the checks, make them more clearer. - Use EXPECT_TRUE instead of EXPECT_EQ(true, something); same thing for the false case. BUG=None TEST=views_unittests --gtest_filter=ViewTest.ViewHierarchyChanged Review URL: http://codereview.chromium.org/7184031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89910 0039d316-1c4b-4281-b951-d872f2087c98
* Adds Layer as a class between View and the Texture.sky@chromium.org2011-06-211-11/+187
| | | | | | | | | | BUG=none TEST=none R=ben@chromium.org,wjmaclean@chromium.org Review URL: http://codereview.chromium.org/7189067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89880 0039d316-1c4b-4281-b951-d872f2087c98
* Fix even more crashes. To help identify remaining crashes now and in the ↵ben@chromium.org2011-06-161-0/+3
| | | | | | | | | | future, I have made the GetWidget methods on WidgetDelegate pure virtual. This will cause classes that don't define them to fail compile instead of crashing at run time. http://crbug.com/86119 TEST=none Review URL: http://codereview.chromium.org/7189019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89409 0039d316-1c4b-4281-b951-d872f2087c98
* Add pressure information to touch event.miletus@chromium.org2011-06-161-4/+4
| | | | | | | | | | | | | | | | | | 1. Add touch pressure information to the views::TouchEvent. The pressure is normalized to be in [0, 1] to conform with W3C Touch Event standard (draft)'s definition on pressure. 2. Augment TouchFactory with the ability to save/query the range of TouchParam. In this patch, the max value of pressure is used to normalize the absolute pressure value extracted from the touch device. BUG=None TEST=None Review URL: http://codereview.chromium.org/7149002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89408 0039d316-1c4b-4281-b951-d872f2087c98
* Add View::ReorderChildView and Widget::MoveToTop.sadrul@chromium.org2011-06-161-0/+54
| | | | | | | | | | | | | | | | | | | | | The z-ordering of child views is currently maintained (implicitly?) by the order they are added to the parent view. It may often be necessary to change the z-order of views, and View::ReorderChildView can be used to do that. I changed views_desktop to have the two pure-views windows to have overlapping regions, and View::ReorderChildView is used to change the z-ordering of the two windows. So it is possible to click a window to activate it and bring it on top of the other. It could have been done without adding Widget::MoveToTop, but given Widget::MoveAbove and MoveAboveWidget, it sounded like a good idea to have Widget::MoveToTop (MoveToFront?). I do now know what the implementation for windows should be, though. So left it as NOTIMPLEMENTED. BUG=none TEST=none Review URL: http://codereview.chromium.org/7185005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89363 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land:ben@chromium.org2011-06-161-4/+4
| | | | | | | | | | | | | | Move private NativeWidget methods to new internal interface NativeWidgetPrivate. This should make it harder to abuse accidentally. BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7170019 Review URL: http://codereview.chromium.org/7189012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89357 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 89216 - Move private NativeWidget methods to new internal interface ↵ben@chromium.org2011-06-151-4/+4
| | | | | | | | | | | | | | | NativeWidgetPrivate. This should make it harder to abuse accidentally. BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7170019 TBR=ben@chromium.org Review URL: http://codereview.chromium.org/7097016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89232 0039d316-1c4b-4281-b951-d872f2087c98
* Move private NativeWidget methods to new internal interface NativeWidgetPrivate.ben@chromium.org2011-06-151-4/+4
| | | | | | | | | | This should make it harder to abuse accidentally. BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7170019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89216 0039d316-1c4b-4281-b951-d872f2087c98
* Add NativeWidgetDelegate::OnTouchEvent and move views::View::TouchStatus to ↵sadrul@chromium.org2011-06-141-14/+14
| | | | | | | | | | | ui::TouchStatus. BUG=none TEST=none Review URL: http://codereview.chromium.org/7147005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89079 0039d316-1c4b-4281-b951-d872f2087c98
* Eliminate Window completely.ben@chromium.org2011-06-131-20/+29
| | | | | | | | BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7108047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88905 0039d316-1c4b-4281-b951-d872f2087c98
* Remove COMPOSITOR_2 flag, old compositor code.wjmaclean@chromium.org2011-06-101-1/+1
| | | | | | | | | BUG=none TEST=compiles, run manually Review URL: http://codereview.chromium.org/6975051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88671 0039d316-1c4b-4281-b951-d872f2087c98
* views: Simplify View::RemoveAllChildViews() function implementation.tfarina@chromium.org2011-06-091-7/+12
| | | | | | | | | | | BUG=72040 TEST=views_unittests --gtest_filter=ViewTest.RemoveAllChildViews R=sky@chromium.org Review URL: http://codereview.chromium.org/7104096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88608 0039d316-1c4b-4281-b951-d872f2087c98
* views: Add unittests for View::RemoveAllChildViews() method.tfarina@chromium.org2011-06-091-0/+33
| | | | | | | | | | | BUG=None TEST=None R=sky@chromium.org,pkasting@chromium.org Review URL: http://codereview.chromium.org/7046074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88557 0039d316-1c4b-4281-b951-d872f2087c98
* Fix remaining views_unittestsben@chromium.org2011-06-081-12/+12
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88370 0039d316-1c4b-4281-b951-d872f2087c98
* Fix views_unittests bustage.ben@chromium.org2011-06-081-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88366 0039d316-1c4b-4281-b951-d872f2087c98
* Move more from Window onto Widget.ben@chromium.org2011-06-081-1/+1
| | | | | | | | BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7054052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88356 0039d316-1c4b-4281-b951-d872f2087c98
* ui/base/models: Simplify TreeNode::GetIndexOf() member function.tfarina@chromium.org2011-06-071-0/+3
| | | | | | | | | | | BUG=None TEST=app_unittests --gtest_filter=TreeNodeModelTest.GetIndexOf R=sky@chromium.org Review URL: http://codereview.chromium.org/7113015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88134 0039d316-1c4b-4281-b951-d872f2087c98
* views: Add unittests for View::GetIndexOf() member function.tfarina@chromium.org2011-06-061-3/+40
| | | | | | | | | | | BUG=None TEST=views_unittests --gtest_filter=ViewTest.GetIndexOf R=sky@chromium.org Review URL: http://codereview.chromium.org/6993062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88041 0039d316-1c4b-4281-b951-d872f2087c98
* views: Take transforms into account when computing visible bounds.sadrul@chromium.org2011-06-061-4/+32
| | | | | | | | | BUG=none TEST=ViewTest.TransformVisibleBound, ViewTest.OnVisibleBoundsChanged Review URL: http://codereview.chromium.org/6993045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87984 0039d316-1c4b-4281-b951-d872f2087c98
* Replace ButtonDropDown menu implementation (Menu2) with MenuItemView.rhashimoto@chromium.org2011-06-011-16/+0
| | | | | | | | | | | | | | | | - Added views::MenuDelegate::WillHideMenu() - Added EMPTY to views::MenuItemView::Type to suppress delegate call. - Minor fixes for views::MenuModelAdapter There was a Windows-only views unit test that a click-drag would post the ButtonDropDown menu. This test relied on TrackPopupMenu not blocking for input if the menu was empty. Because MenuItemView does block, this test could not work as a unit test. I removed this test and added an interactive ui test to do the same thing. BUG=chromium-os:13887 TEST=none Review URL: http://codereview.chromium.org/7044016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87490 0039d316-1c4b-4281-b951-d872f2087c98
* Changing Checkbox class to use NativeTheme class for rendering instead ofrogerta@chromium.org2011-06-011-3/+3
| | | | | | | | | | | | | native controls. The original Checkbox class is renamed to NativeCheckbox. BUG=None TEST=The affected locations are: chromeos EULA page, uninstall view, chromeos wifi config, and create application shortcut view. Should verify that checkboxes in these locations look and behave as they did before. Review URL: http://codereview.chromium.org/7082041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87484 0039d316-1c4b-4281-b951-d872f2087c98
* Make Widget ownership a little clearer by expressing it in terms of an enum.ben@chromium.org2011-05-251-5/+5
| | | | | | | | BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7031053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86669 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes rounding bug in transform. This is needed to avoid roundingsky@chromium.org2011-05-241-0/+9
| | | | | | | | | | | | | something like -.9998 to 0 instead of -1. Without this a transformed views bounds would end up with an extra scale-1 pixels on the left edge. BUG=none TEST=covered by unit test R=ben@chromium.org,wjmaclean@chromium.org Review URL: http://codereview.chromium.org/7066010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86430 0039d316-1c4b-4281-b951-d872f2087c98