summaryrefslogtreecommitdiffstats
path: root/views/view.cc
Commit message (Collapse)AuthorAgeFilesLines
* Removes code added to track down crash. The crash seems to havesky@chromium.org2011-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | occurred for two reasons: . window class name changing out from under us. . CreateWindow returning NULL because we're out of memory. I've changed the following: . Left in CHECK on return from CreateWindow. . Removed dependency on class name. We don't really need it anyway. I've also changed View::PaintFocusableBorder to check focusable last, as that requires looking up the FocusManager BUG=77651 TEST=none Review URL: http://codereview.chromium.org/6865023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81812 0039d316-1c4b-4281-b951-d872f2087c98
* Call OnVisibleBoundsChanged on the view itself as well as child views.oshima@google.com2011-04-141-0/+5
| | | | | | | | | | | This fixes crosbug.com/14079 BUG=chromium-os:14079, chromium-os:79269 TEST=none Review URL: http://codereview.chromium.org/6837010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81641 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes bug in View::OnBoundsChange painting the old/new. The codesky@chromium.org2011-04-061-7/+18
| | | | | | | | | | | | wasn't adjusting for RTL. BUG=none TEST=none R=ben@chromium.org,davemoore@chromium.org Review URL: http://codereview.chromium.org/6793050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80663 0039d316-1c4b-4281-b951-d872f2087c98
* Integrate the new input method API for Views into Chromium.suzhe@google.com2011-04-011-2/+2
| | | | | | | | | | | | | | | | | | This CL contains following changes: 1. Improve TextfieldViewsModel to support composition text. 2. Implement TextInputClient interface in NativeTextfieldViews. 3. Fix Textfield and native implementations to avoid calling TextfieldController::ContentsChanged() when the text is changed by calling Textfield::SetText() or AppendText(). 4. Fix a bug in FocusManager that causes NativeTextfieldViewsTest.FocusTraversalTest to fail. 5. Fix accelerator_handler_touch.cc to send key events to the top-level widget's input method instance instead of the root view. 6. Do the same fix in extension_input_api.cc. 7. Hook InputMethod into WidgetGtk and WidgetWin. BUG=75003 TEST=views_unittests --gtest_filter=NativeTextfieldViews* Review URL: http://codereview.chromium.org/6675005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80226 0039d316-1c4b-4281-b951-d872f2087c98
* New InputMethod api for Views.suzhe@google.com2011-03-311-0/+9
| | | | | | | | | | | | | | This CL adds: 1. Interfaces: InputMethod, InputMethodDelegate, TextInputClient. 2. InputMethodGtk: an InputMethod implementation based on GtkIMContext. 3. MockInputMethod: a mock InputMethod implementation for unit tests. BUG=75003 TEST=none Review URL: http://codereview.chromium.org/6688049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80076 0039d316-1c4b-4281-b951-d872f2087c98
* Disambiguate OnMouseCaptureLost from OnMouseReleased.msw@chromium.org2011-03-291-5/+8
| | | | | | | | | | | | | Nix RenderWidgetHostViewViews' OnMouseCaptureLost forwarding. Consolidate code, remove unnecessary overrides, etc. Fix up test, |event| args, OVERRIDEs, and (c) dates. BUG=72040 TEST=Views mouse button release, cancelling mouse down/drag. Review URL: http://codereview.chromium.org/6685069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79640 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor: Move gfx/compositor* to gfx/compositor/backer@chromium.org2011-03-231-1/+1
| | | | | | | | | | | compositor_gl.cc (in gfx) depends on app_base (for gl_bindings), but app_base depends on gfx. This gets rid of the cyclic dependency. It is part of the larger effort to move app/gfx/gl to ui/gfx/gl. BUG=none TEST=trybots Review URL: http://codereview.chromium.org/6718034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79127 0039d316-1c4b-4281-b951-d872f2087c98
* Have a helper class to automatically save and restore the canvas ↵sadrul@chromium.org2011-03-151-18/+41
| | | | | | | | | | | transformation state. BUG= TEST= Review URL: http://codereview.chromium.org/6677035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78250 0039d316-1c4b-4281-b951-d872f2087c98
* Start working on compositor tree painting.sadrul@chromium.org2011-03-151-28/+81
| | | | | | | | | | | | | As a first step, maintain a skia canvas in each transformed view. Each transformed view will acquire a texture-id for the canvas it owns. Whenever the canvas is updated, it will trigger a refresh in the compositor tree. BUG=none TEST=none Review URL: http://codereview.chromium.org/6594125 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78149 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up some event code:msw@chromium.org2011-03-141-74/+75
| | | | | | | | | | | Update some RootView event construction. Fixup some *MouseExited/OnLeaveNotify codepaths. Normalize event argument names. Move View::ConvertPoint*Ancestor defs to private section. Review URL: http://codereview.chromium.org/6685018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78121 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land: Refactor Views accessibility.dmazzoni@chromium.org2011-03-141-43/+6
| | | | | | | | | BUG=74988 TEST=none Review URL: http://codereview.chromium.org/6581010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78006 0039d316-1c4b-4281-b951-d872f2087c98
* This will help minimize the area we paint various views, including ↵davemoore@chromium.org2011-03-091-15/+22
| | | | | | | | | | | | | | | | | BrowserView in cros. Before the default when a child's preferred view size changed was to propagate it up and paint everything from the rootview down. This will limit the area to the parts that actually changed size. I expect we may find things that aren't being painted because they were assuming the behavior of Layout(). We should fix this as necessary. Also, a subsequent change will minimize our calls to SchedulePaint(). We frequently do it when we don't need to. BUG=None TEST=ViewTest.SetBoundsPaint Review URL: http://codereview.chromium.org/6531032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77481 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed spelling and typos.wyck@chromium.org2011-03-091-3/+3
| | | | | | | | | | | Only comments were changed. No code was harmed in the making of this CL. BUG=None TEST=None Review URL: http://codereview.chromium.org/6625015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77410 0039d316-1c4b-4281-b951-d872f2087c98
* Do all OOLing in the views code. linux_views now builds clean with the clang ↵erg@google.com2011-03-041-0/+53
| | | | | | | | | | | plugin. BUG=carnitas TEST=compiles Review URL: http://codereview.chromium.org/6622002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76992 0039d316-1c4b-4281-b951-d872f2087c98
* Change other usages of .size() to .empty() when applicable.erg@google.com2011-03-041-4/+1
| | | | | | | | | BUG=carnitas TEST=compiles Review URL: http://codereview.chromium.org/6609008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76962 0039d316-1c4b-4281-b951-d872f2087c98
* Rename ContextMenuController::ShowContextMenu() to ShowContextMenuForView().thakis@chromium.org2011-03-041-1/+1
| | | | | | | | | | | | | | | For classes deriving from both View and ContextMenuController, this makes it clear which of method is overridden. Rename TabController::ShowContextMenu to ShowContextMenuForTab for the same reason. No intended functionality change. BUG=70465,72205 TEST=none TBR=beng git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76878 0039d316-1c4b-4281-b951-d872f2087c98
* Rename the methods in DragController.thakis@chromium.org2011-03-041-3/+4
| | | | | | | | | | | | | | | They used to have the same name as methods in View. Some views would derive from both View and DragController, which was confusing. For example for clang's -Woverride-virtual. No functionality change. BUG=70465,72205 TEST=none Review URL: http://codereview.chromium.org/6609033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76847 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 76825 - Refactor Views accessibility.jcivelli@chromium.org2011-03-041-6/+27
| | | | | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/6581010 TBR=dmazzoni@chromium.org Review URL: http://codereview.chromium.org/6612035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76844 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor Views accessibility.dmazzoni@chromium.org2011-03-031-27/+6
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/6581010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76825 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up more of Widget.ben@chromium.org2011-03-031-6/+10
| | | | | | | | | | | | - Move cross platform code to Widget. - Move platform-specific code into focused Widget* implementations. BUG=72040 TEST=existing Review URL: http://codereview.chromium.org/6609023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76790 0039d316-1c4b-4281-b951-d872f2087c98
* Replace Widget::GetBounds with Widget::GetClientScreenBounds and ↵ben@chromium.org2011-03-031-4/+2
| | | | | | | | | | | GetWindowScreenBounds BUG=72040 TEST=none Review URL: http://codereview.chromium.org/6615016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76759 0039d316-1c4b-4281-b951-d872f2087c98
* Use GetEventHandlerForPoint instead of GetViewForPoint.sadrul@chromium.org2011-02-251-9/+2
| | | | | | | | | BUG=74121 TEST=none Review URL: http://codereview.chromium.org/6575050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76102 0039d316-1c4b-4281-b951-d872f2087c98
* Transformable views: Use the transformation for points and events.sadrul@chromium.org2011-02-241-63/+117
| | | | | | | | | | | | | Added and updated API for converting points between views' coordinate systems, taking transformations into consideration. This in turn gives us, for free, transformation for located events (mouse events, touch events). BUG=none TEST=ViewTest.TransformEvent Review URL: http://codereview.chromium.org/6534015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75960 0039d316-1c4b-4281-b951-d872f2087c98
* views: Factor out from View class some metric functions and constants into ↵tfarina@chromium.org2011-02-241-3/+0
| | | | | | | | | | | | | its own files. (Note: This was a TODO for ben to move to metrics.h) BUG=None TEST=trybots Review URL: http://codereview.chromium.org/6577004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75841 0039d316-1c4b-4281-b951-d872f2087c98
* Rename WillGain/Lose/DidGainFocus, Focus methods. Now there are only two ↵ben@chromium.org2011-02-241-10/+18
| | | | | | | | | | | | | | | | | | | | notifications: OnFocus() OnBlur() View gains a Focus()/Blur() processing method pair. Cleans up code in FocusManager::SetFocusedView. Also adds OVERRIDE to a bunch of methods. BUG=72040 TEST=existing unittests. Review URL: http://codereview.chromium.org/6577010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75830 0039d316-1c4b-4281-b951-d872f2087c98
* Dramatically simplify view painting by getting rid of RootView's redundant ↵ben@chromium.org2011-02-231-15/+4
| | | | | | | | knowledge of invalid rects.The OS is capable of doing this for us (see: InvalidateRect, etc.), so we should just defer to it.I was also able to remove all of the custom logic in WindowWin::OnNCPaint and replace it with a simple SetMsgHandled check.http://crbug.com/72040TEST=none Review URL: http://codereview.chromium.org/6469096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75758 0039d316-1c4b-4281-b951-d872f2087c98
* Remove usages of RootView from View by moving relevant RootView API methods ↵ben@chromium.org2011-02-181-29/+16
| | | | | | | | | | | | | to Widget. This results in some code duplication right now but this will be mitigated once all platforms use WidgetImpl. http://crbug.com/72040 TEST=existing tests Review URL: http://codereview.chromium.org/6507028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75431 0039d316-1c4b-4281-b951-d872f2087c98
* Remove "visible bounds in root changed" functions from RootView, move them ↵ben@chromium.org2011-02-161-43/+52
| | | | | | | | | | | | | to View. Clean up the API a little. Adds a BoundsChanged() processing function to View that does default processing for bounds-changed events, including notifying the view via OnBoundsChanged() and potentially notifying of visible bounds changing. Adds a unit test for OnVisibleBoundsChanged. http://crbug.com/72040 TEST=unit test Review URL: http://codereview.chromium.org/6534001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75182 0039d316-1c4b-4281-b951-d872f2087c98
* Fix SkRectToRect.sadrul@chromium.org2011-02-161-5/+1
| | | | | | | | | BUG=none TEST=RectTest.SkRectToRect Review URL: http://codereview.chromium.org/6525031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75159 0039d316-1c4b-4281-b951-d872f2087c98
* Rename ProcessPaint to Paint()ben@chromium.org2011-02-161-39/+41
| | | | | | | | | | | | Make OnPaint* methods protected. http://crbug.com/72040 TEST=none TBR=sky Review URL: http://codereview.chromium.org/6529037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75063 0039d316-1c4b-4281-b951-d872f2087c98
* Rename Paint* -> OnPaint*ben@chromium.org2011-02-161-8/+8
| | | | | | | | | http://crbug.com/72040 TEST=none TBR=sky Review URL: http://codereview.chromium.org/6499030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75033 0039d316-1c4b-4281-b951-d872f2087c98
* views transformation: First cut.sadrul@chromium.org2011-02-151-3/+77
| | | | | | | | | | | This is a first cut at the transformable views. Skia transformation matrices are used to apply transformation (rotate, scale, translation). Support for clipping is also added (but not through the matrix). Currently, the transformation is applied only for painting. A future CL will apply the transformation for various events. BUG=none TEST=ViewTest.TransformPaint Review URL: http://codereview.chromium.org/6500008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75023 0039d316-1c4b-4281-b951-d872f2087c98
* Rename SchedulePaint(gfx::Rect..) to SchedulePaintInRectben@chromium.org2011-02-151-6/+6
| | | | | | | | | http://crbug.com/72040 TEST=existing tests Review URL: http://codereview.chromium.org/6480076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74987 0039d316-1c4b-4281-b951-d872f2087c98
* Migrate Event API methods to Google Style.ben@chromium.org2011-02-101-1/+1
| | | | | | | | | | | | | | Re-landing, moving the bits Mac uses to ui/base/events.h BUG=72040 TEST=none TBR=sky Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=74377 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74408 0039d316-1c4b-4281-b951-d872f2087c98
* Rework tree APIs to reflect Google style and more const-correctness.Also, ↵ben@chromium.org2011-02-091-182/+124
| | | | | | | | | | | move PrintViewHierarchy/PrintFocusHierarchy out into a separate header. BUG=72040 TEST=None Review URL: http://codereview.chromium.org/6452011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74244 0039d316-1c4b-4281-b951-d872f2087c98
* It turns out I had the sense of the GetLocalBounds bool wrong everywhere, so ↵ben@chromium.org2011-02-091-1/+1
| | | | | | | | | | | | | | invert everything. This fixes the painting bugs in the omnibox and bookmark bar, and probably countless other glitches in rendering. BUG=none TEST=omnibox popup should render properly TBR=sky Review URL: http://codereview.chromium.org/6462022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74231 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up RTL methods.ben@chromium.org2011-02-081-30/+24
| | | | | | | | | | | | | | No one used the non-RTL version of GetBounds(), so I renamed it GetMirroredBounds() and got rid of the enum. Same for GetX(), consolidated with MirroredX() into GetMirroredX(). GetPosition() already took into account mirroring, so renamed GetMirroredPosition() for symmetry. Renamed the other functions to be getters. De-inlined a few that were doing complex looking stuff. http://crbug.com/72040 TEST=none Review URL: http://codereview.chromium.org/6334152 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74087 0039d316-1c4b-4281-b951-d872f2087c98
* Rework basic bounds methods on View to match new V2 API: ben@chromium.org2011-02-081-35/+57
| | | | | | | | | | | | | | | | SetBounds(const gfx::Rect& rect) -> SetBoundsRect(); DidChangeBounds()->OnBoundsChanged() GetLocalBounds(false)->GetLocalBounds() GetLocalBounds(true)->GetContentsBounds() Moved GetBounds(), GetX(), and GetPosition into RTL section. http://crbug.com/72040 TEST=none Review URL: http://codereview.chromium.org/6410109 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74052 0039d316-1c4b-4281-b951-d872f2087c98
* Change includes of gfx/* to ui/gfx/*sail@chromium.org2011-02-051-2/+2
| | | | | | | | | BUG=71063 TEST=compiled Review URL: http://codereview.chromium.org/6312156 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73890 0039d316-1c4b-4281-b951-d872f2087c98
* Sort the methods in views into sections, and make .cc order match .hben@chromium.org2011-02-051-900/+909
| | | | | | | | | | | | This is the first phase of upgrading views::View to the V2 API. BUG=none TEST=none TBR=sky Review URL: http://codereview.chromium.org/6413001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73881 0039d316-1c4b-4281-b951-d872f2087c98
* Only keep accelerators registered while the window is visibleasanka@chromium.org2011-02-021-1/+12
| | | | | | | | | BUG=69683 TEST=ViewTest.HiddenViewWithAccelerator Review URL: http://codereview.chromium.org/6271010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73473 0039d316-1c4b-4281-b951-d872f2087c98
* views: Move layout_manager.[cc,h] into layout directory.tfarina@chromium.org2011-01-251-2/+2
| | | | | | | | | | | The other layout files will be moved later. BUG=None TEST=trybots Review URL: http://codereview.chromium.org/6374011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72507 0039d316-1c4b-4281-b951-d872f2087c98
* Delay deletion of view in View::DoRemoveChildViewbattre@chromium.org2011-01-251-1/+3
| | | | | | | | | BUG=70771 TEST=none Review URL: http://codereview.chromium.org/6267013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72499 0039d316-1c4b-4281-b951-d872f2087c98
* Move a bunch of random other files to src/ui/baseben@chromium.org2011-01-201-2/+2
| | | | | | | | | | BUG=none TEST=none TBR=brettw Review URL: http://codereview.chromium.org/6257006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71970 0039d316-1c4b-4281-b951-d872f2087c98
* Move more dnd related files to ui/baseben@chromium.org2011-01-191-6/+6
| | | | | | | | | | BUG=none TEST=none TBR=brettw Review URL: http://codereview.chromium.org/6250014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71828 0039d316-1c4b-4281-b951-d872f2087c98
* touch: Return an enum from OnTouchEvent.sadrul@chromium.org2011-01-181-5/+4
| | | | | | | | | | | The enum returned from OnTouchEvent reflects the current status of the touch-sequence. This can be used by the RootView to determine when the touch-event-handler should be reset. BUG=none TEST=none Review URL: http://codereview.chromium.org/6347002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71677 0039d316-1c4b-4281-b951-d872f2087c98
* Remove wstring from views. Part 3: Switch accessibility strings to string16.avi@chromium.org2011-01-141-4/+4
| | | | | | | | | BUG=68267 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6192007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71461 0039d316-1c4b-4281-b951-d872f2087c98
* Remove wstring from views. Part 1: Switch member variables to string16.avi@chromium.org2011-01-101-2/+2
| | | | | | | | | BUG=68267 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6123003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70899 0039d316-1c4b-4281-b951-d872f2087c98
* Remove more 'using' declarations of Scoped* from scoped_handle_win.htfarina@chromium.org2010-12-291-2/+3
| | | | | | | | | BUG=None TEST=trybots Review URL: http://codereview.chromium.org/6040002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70286 0039d316-1c4b-4281-b951-d872f2087c98