summaryrefslogtreecommitdiffstats
path: root/views/window
Commit message (Collapse)AuthorAgeFilesLines
* Rename VIEWS_API to VIEWS_EXPORT.darin@chromium.org2011-08-056-13/+13
| | | | | | | R=rvargas@chromium.org Review URL: http://codereview.chromium.org/7550038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95651 0039d316-1c4b-4281-b951-d872f2087c98
* Create views.dll / libviews.sodarin@chromium.org2011-07-286-12/+15
| | | | | | | 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
* Don't add GetWindowBoundsForClientBounds() in NativeFrameView's ↵asvitkine@chromium.org2011-07-192-6/+8
| | | | | | | | | | | | | GetPreferredSize(). This is no longer necessary as this is now accounted for in native_widget_win.cc as of http://crrev.com/92600. BUG=89631 TEST=Open about box and check its size. Open alert() dialog and check its size. Review URL: http://codereview.chromium.org/7437002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93095 0039d316-1c4b-4281-b951-d872f2087c98
* Allow different kinds of 'desktops'.sadrul@chromium.org2011-07-131-2/+10
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/7315007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92447 0039d316-1c4b-4281-b951-d872f2087c98
* Rename app_strings to ui_strings.tfarina@chromium.org2011-07-072-2/+2
| | | | | | | | | | | BUG=72317 TEST=None R=rsesek@chromium.org, tony@chromium.org Review URL: http://codereview.chromium.org/7210060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91704 0039d316-1c4b-4281-b951-d872f2087c98
* Move app/resources/* to ui/resources/ directory.tfarina@chromium.org2011-06-292-4/+4
| | | | | | | | | | | BUG=72317 TEST=None R=rsesek@chromium.org Review URL: http://codereview.chromium.org/7253057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91010 0039d316-1c4b-4281-b951-d872f2087c98
* Updated remaining button to text button. Reverted the interposedsaintlou@chromium.org2011-06-233-19/+19
| | | | | | | | | | | 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
* Eliminate Window completely.ben@chromium.org2011-06-1321-725/+62
| | | | | | | | 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
* Move last of event handlers down to NativeWidgetWin/Gtk.ben@chromium.org2011-06-098-913/+3
| | | | | | | | BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7129022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88564 0039d316-1c4b-4281-b951-d872f2087c98
* Move more from Window onto Widget.ben@chromium.org2011-06-0817-818/+53
| | | | | | | | 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
* Add some missing view class name to better debug view miletus@chromium.org2011-06-032-0/+21
| | | | | | | | | | | | | hierarchy. BUG= TEST= Review URL: http://codereview.chromium.org/7024025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87882 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land: Move NonClientView and FrameType logic from Window to Widget.ben@chromium.org2011-06-0316-350/+74
| | | | | | | | | | Also fixes leak of default WidgetDelegate by replacing it with a DefaultWidgetDelegate subclass that overrides DeleteDelegate and deletes itself. This required moving the destruction logic from Window down onto Widget. BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7033049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87784 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 87702 - Move NonClientView and FrameType logic from Window to Widget.ben@chromium.org2011-06-0216-74/+350
| | | | | | | | | | | | | Also fixes leak of default WidgetDelegate by replacing it with a DefaultWidgetDelegate subclass that overrides DeleteDelegate and deletes itself. This required moving the destruction logic from Window down onto Widget. BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7033049 TBR=ben@chromium.org Review URL: http://codereview.chromium.org/7109028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87719 0039d316-1c4b-4281-b951-d872f2087c98
* Move NonClientView and FrameType logic from Window to Widget.ben@chromium.org2011-06-0216-350/+74
| | | | | | | | | | Also fixes leak of default WidgetDelegate by replacing it with a DefaultWidgetDelegate subclass that overrides DeleteDelegate and deletes itself. This required moving the destruction logic from Window down onto Widget. BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7033049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87702 0039d316-1c4b-4281-b951-d872f2087c98
* Add some view class name to better debug view hierarchymiletus@chromium.org2011-06-022-2/+14
| | | | | | | | | | | | BUG=None TEST=None R= Review URL: http://codereview.chromium.org/6976053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87689 0039d316-1c4b-4281-b951-d872f2087c98
* WidgetDelegate is now always created. Specified through InitParams, if NULL ↵ben@chromium.org2011-06-021-2/+1
| | | | | | | | | | Widget will make a default one. BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7080068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87609 0039d316-1c4b-4281-b951-d872f2087c98
* Move the last of the easy stuff from Window onto Widget.ben@chromium.org2011-06-019-366/+11
| | | | | | | | BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7080060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87517 0039d316-1c4b-4281-b951-d872f2087c98
* Move Fullscreen API onto Widget.ben@chromium.org2011-06-019-153/+1
| | | | | | | | BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7105003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87476 0039d316-1c4b-4281-b951-d872f2087c98
* Move methods from WindowDelegate onto WidgetDelegate.ben@chromium.org2011-05-312-220/+2
| | | | | | | | | BUG=72040 TEST=none TBR=sky Review URL: http://codereview.chromium.org/7078008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87349 0039d316-1c4b-4281-b951-d872f2087c98
* Removing DeleteSoon() from WigetGtk so it behaves like WidgetWinglotov@google.com2011-05-312-1/+5
| | | | | | | | | | | | This is a retry of http://codereview.chromium.org/7002029/ after it has been reverted because of the failing test BrowserTest.CloseWithAppMenuOpen (failed only on buildbot) BUG=chromium-os:15129 TEST=tests Review URL: http://codereview.chromium.org/7082042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87294 0039d316-1c4b-4281-b951-d872f2087c98
* Move SetWindowBounds onto Widget.ben@chromium.org2011-05-279-94/+2
| | | | | | | | BUG=72040 TEST=none Review URL: http://codereview.chromium.org/6976047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87073 0039d316-1c4b-4281-b951-d872f2087c98
* Move a bunch of functions from Window onto Widget.ben@chromium.org2011-05-279-363/+66
| | | | | | | | | BUG=72040 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=86914 Review URL: http://codereview.chromium.org/7075019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87029 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 86914 - Move a bunch of functions from Window onto Widget.wtc@chromium.org2011-05-279-66/+363
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many tests in browser_tests crashed with a LOG(DFATAL) message on Chrome OS: [28862:28862:0526/153905:3290241082989:FATAL:browser_main.cc(955)] GLib-GObject: invalid (NULL) pointer instance Backtrace: base::debug::StackTrace::StackTrace() [0x33308d6] logging::LogMessage::~LogMessage() [0x334df2e] (anonymous namespace)::GLibLogHandler() [0x7c7d45] 0x2ab2a37a7fb9 0x2ab2a37a83d3 0x2ab2a313302a 0x2ab2a31315c5 views::NativeWidgetGtk::InitNativeWidget() [0x1a30dcf] views::Widget::Init() [0x1a37fa7] NativeTabContentsViewGtk::InitNativeTabContentsView() [0x10c6b83] TabContentsViewViews::CreateView() [0x397ac46] TabContents::TabContents() [0x1501e09] Browser::TabContentsFactory() [0xc84725] browser::Navigate() [0xc954c7] Browser::AddSelectedTabWithURL() [0xc76d9e] (anonymous namespace)::InitializeBrowser() [0x70be3d] InProcessBrowserTest::CreateBrowser() [0x70d178] InProcessBrowserTest::RunTestOnMainThreadLoop() [0x70d34a] [...snipped...] BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7075019 R=msw@chromium.org TBR=ben@chromium.org Review URL: http://codereview.chromium.org/6976040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86939 0039d316-1c4b-4281-b951-d872f2087c98
* Move a bunch of functions from Window onto Widget.ben@chromium.org2011-05-269-363/+66
| | | | | | | | BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7075019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86914 0039d316-1c4b-4281-b951-d872f2087c98
* Rough cut at window activation.ben@chromium.org2011-05-261-2/+1
| | | | | | | | http://crbug.com/84070 TEST=none Review URL: http://codereview.chromium.org/7071017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86869 0039d316-1c4b-4281-b951-d872f2087c98
* Adds a basic NativeWindowViews.ben@chromium.org2011-05-255-7/+251
| | | | | | | | http://crbug.com/83663 TEST=none Review URL: http://codereview.chromium.org/7069022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86736 0039d316-1c4b-4281-b951-d872f2087c98
* views: Fix an operator precedence error found by PVS Studio.thakis@chromium.org2011-05-251-1/+1
| | | | | | | | | | BUG=83891 TEST=none Review URL: http://codereview.chromium.org/6987021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86652 0039d316-1c4b-4281-b951-d872f2087c98
* Fix clang.ben@chromium.org2011-05-202-18/+27
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86085 0039d316-1c4b-4281-b951-d872f2087c98
* Move RootView to the internal namespace.ben@chromium.org2011-05-202-3/+0
| | | | | | | | | | | Most people should not be using the RootView type. The few cases that do should static_cast for now, until I can find a way to expose the functionality they need on Widget. BUG=72040 TEST=none TBR=sky Review URL: http://codereview.chromium.org/7040018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86084 0039d316-1c4b-4281-b951-d872f2087c98
* ui/base/models: Convert GetKeyCode() to unit_hacker() style (key_code()).tfarina@chromium.org2011-05-201-2/+2
| | | | | | | | | | | | | Note: This was a TODO for beng. BUG=None TEST=None R=ben@chromium.org Review URL: http://codereview.chromium.org/7050025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86079 0039d316-1c4b-4281-b951-d872f2087c98
* Rename WindowWin|Gtk->NativeWindowWin|Gtkben@chromium.org2011-05-196-192/+206
| | | | | | | | | BUG=72040 TEST=none TBR=sky Review URL: http://codereview.chromium.org/7048006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85969 0039d316-1c4b-4281-b951-d872f2087c98
* Rename WidgetWin/Gtk -> NativeWidgetWin/Gtk.ben@chromium.org2011-05-195-49/+50
| | | | | | | | | BUG=72040 TEST=none TBR=sky Review URL: http://codereview.chromium.org/7039050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85910 0039d316-1c4b-4281-b951-d872f2087c98
* Alert boxes shouldn't have a taskbar presence.ben@chromium.org2011-05-181-0/+3
| | | | | | | | | | | | Basically we were ignoring parent/owner window specification in CreateChromeWindow. I need to make InitParams have more of an API, but not in this CL. BUG=80947 TEST=see bug Review URL: http://codereview.chromium.org/7044011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85799 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up a few things now that specialized window types are subclasses of ↵ben@chromium.org2011-05-181-8/+3
| | | | | | | | | | Window/Widget. BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7045010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85797 0039d316-1c4b-4281-b951-d872f2087c98
* Fix some rendering glitches in the custom frame by re-introducing nasty old ↵ben@chromium.org2011-05-182-17/+108
| | | | | | | | | | code since I have found no way to avoid using it. BUG=79640 TEST=see bug Review URL: http://codereview.chromium.org/7038021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85774 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land:ben@chromium.org2011-05-186-62/+48
| | | | | | | | | | | | Consolidate ShouldUseNativeFrame/AlwaysUseNativeFrame/UseNativeFrame spaghetti. See earlier commit in log for full description. THIS WILL BREAK chrome_frame_tests! BUG=none TEST=none Review URL: http://codereview.chromium.org/7036011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85765 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 85666 - Consolidate ↵ben@chromium.org2011-05-186-50/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ShouldUseNativeFrame/AlwaysUseNativeFrame/UseNativeFrame spaghetti. Now there is: ... window::ShouldUseNativeFrame() Which is basically just a pass-thru to WindowWin::ShouldUseNativeFrame() ... which can be overridden by subclasses. Native-Frame is a windows-only concept but keeping the API on Window means I don't have to update a lot of call sites. Window also gains a FrameType state member that toggles three states - default, force-native and force-custom. This supercedes the "AlwaysUseNativeFrame/AlwaysUseCustomFrame" methods on NonClientView. I have also hooked up a context menu item behind a command line flag --debug-enable-frame-toggle that allows the frame type for an individual window to be toggled, useful for debugging. BUG=none TEST=none Review URL: http://codereview.chromium.org/7036014 TBR=ben@chromium.org Review URL: http://codereview.chromium.org/6975037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85702 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 85668 - These two un-reviewed lines made it into my last commit and ↵ben@chromium.org2011-05-181-1/+2
| | | | | | | | | weren't part of the change. Removing. TBR=ben@chromium.org Review URL: http://codereview.chromium.org/7039028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85701 0039d316-1c4b-4281-b951-d872f2087c98
* These two un-reviewed lines made it into my last commit and weren't part of ↵ben@chromium.org2011-05-171-2/+1
| | | | | | the change. Removing. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85668 0039d316-1c4b-4281-b951-d872f2087c98
* Consolidate ShouldUseNativeFrame/AlwaysUseNativeFrame/UseNativeFrame spaghetti.ben@chromium.org2011-05-176-63/+50
| | | | | | | | | | | | | | | | | | | | | | | Now there is: ... window::ShouldUseNativeFrame() Which is basically just a pass-thru to WindowWin::ShouldUseNativeFrame() ... which can be overridden by subclasses. Native-Frame is a windows-only concept but keeping the API on Window means I don't have to update a lot of call sites. Window also gains a FrameType state member that toggles three states - default, force-native and force-custom. This supercedes the "AlwaysUseNativeFrame/AlwaysUseCustomFrame" methods on NonClientView. I have also hooked up a context menu item behind a command line flag --debug-enable-frame-toggle that allows the frame type for an individual window to be toggled, useful for debugging. BUG=none TEST=none Review URL: http://codereview.chromium.org/7036014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85666 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes 82927 by rolling back part of a change I made this morning. We can't ↵ben@chromium.org2011-05-171-0/+6
| | | | | | | | | | | hide the window during WM_NCLBUTTONDOWN after all. BUG=82927 TEST=none TBR=sky Review URL: http://codereview.chromium.org/7017021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85658 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes more default non-client frame painting.ben@chromium.org2011-05-172-4/+13
| | | | | | | | http://crbug.com/22704 TEST=see bug Review URL: http://codereview.chromium.org/7030025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85628 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 85528 - We were returning the wrong value of ShouldUseNativeFrame for ↵ben@chromium.org2011-05-161-1/+1
| | | | | | | | | | | | | | | popup windows when a theme is installed and the rest of the desktop is in glass mode. We were returning false instead of true, even though themes are applied only to tabbed browser windows. This means that even though the window was rendered using the glass frame (due to a correct check somewhere else) the widget calculated the client size incorrectly. http://crbug.com/80774 TEST=none Review URL: http://codereview.chromium.org/7015057 TBR=ben@chromium.org Review URL: http://codereview.chromium.org/7034019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85536 0039d316-1c4b-4281-b951-d872f2087c98
* We were returning the wrong value of ShouldUseNativeFrame for popup windows ↵ben@chromium.org2011-05-161-1/+1
| | | | | | | | | | | | when a theme is installed and the rest of the desktop is in glass mode. We were returning false instead of true, even though themes are applied only to tabbed browser windows. This means that even though the window was rendered using the glass frame (due to a correct check somewhere else) the widget calculated the client size incorrectly. http://crbug.com/80774 TEST=none Review URL: http://codereview.chromium.org/7015057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85528 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land:ben@chromium.org2011-05-1312-188/+130
| | | | | | | | | | | | Split the hierarchy. Now with AutocompletePopup implementing SupportsWeakPtr as before. This fixes the Windows XP crashes in browser_tests. BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7015051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85298 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 85269 - Split the hierarchy. ben@chromium.org2011-05-1312-130/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Widget ---- Now recognizes a supplied NativeWidget via InitParams. If this is specified then a default one is not created. Is now created directly rather than using a factory. NativeWidget creation is not performed until Init() is called. This means some functions that rely on a NativeWidget must not be called until _AFTER_ Init() (explains some of the function call reordering in this CL, e.g. moving SetOpacity() until after Init()). ResetLastMouseMovedFlag() moved to this API so that BaseTabStrip can call it in a cross-platform way. Made last remaining unimplemented methods on Widget pass-thru to NativeWidget implementations. * WidgetWin/WidgetGtk ---- The NativeWidget implementations now both require a NativeWidgetDelegate implementation upon construction. This is passed through the constructor by the static factory method NativeWidget::CreateNativeWidget and by subclasses such as WindowWin, BubbleWidgetWin, etc. Some classes that are constructed directly (e.g. LockWindow, in ChromeOS) never have a Widget created for them, so they create the Widget themselves in their base class initializer. Code in these classes (and their WindowWin/WindowGtk, BrowserFrameWin, BrowserFrameGtk subclasses) must now call GetWidget() etc to call Widget API methods since they are no longer subclasses. static_casting to this (and derived) types must now be done on the Widget's native_widget(). GetWindow() is renamed to GetContainingWindow() to avoid naming conflicts. * Window ---- Window is now a subclass of Widget. Now recognizes a supplied NativeWindow via InitParams. If this is specified then a default one is not created. Window::CloseWindow becomes an override of Widget::Close. CloseAllSecondaryWindows() becomes CloseAllSecondaryWidgets() and moves to widget.h IsAppWindow() is removed and replaced by set_is_secondary_widget on Widget. * MenuHost ---- Subclasses Widget now. * TabContentsViewViews ---- It looks like the Gtk-views code here was still using the old implementation of the Native version of this class - i.e. a class that subclassed TabContentsView AND WidgetGtk. A no-no. I had to write NativeTabContentsViewGtk, which is almost identical to NativeTabContentsViewWin with the Gtk bits of TabContentsViewGtk thrown in. * BrowserFrame ---- Platform-specific functionality is now restricted to BrowserFrameWin/BrowserFrameGtk behind a NativeBrowserFrame interface. Construction is exposed via a static factory method on NativeBrowserFrame. BrowserFrame becomes a concrete class that now subclasses Window. As a result, it no longer needs a GetWindow() accessor method, so people with a BrowserFrame* can just call Window methods directly on it. It is constructed directly, replacing the BrowserFrame::Create() method. NativeBrowserFrameDelegate is no longer needed. BrowserFrameChromeos is simpler as a couple of #ifdefs in BrowserFrame, so I got rid of that too. * AutocompletePopupWin/Gtk ---- No longer required. AutocompletePopupContentsView now just uses a Widget directly. * There is some lingering ugliness: - If you set a native_window field on Window::InitParams you must also manually set widget_init_params.native_widget. I will make InitParams do more of this automatically later. - It'd be nice for the ContentsView to be specified via InitParams. I'll get to this later. - NativeBrowserFrame could probably disappear as an interface. It only exists to provide a couple of methods that may be implemented in other ways. - delete_on_destroy should now be an ownership directionality enum. I will do this later. - Secondary-widgetness should somehow be inferred from transience. Later. - set_focus_on_creation for both the NativeWidgets should probably move to Widget if it is really needed. - WidgetWin/Gtk::SetInitialFocus seems like it could move to Widget. - I need to clean up function order in some cases. BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7012006 TBR=ben@chromium.org Review URL: http://codereview.chromium.org/7011038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85283 0039d316-1c4b-4281-b951-d872f2087c98
* Split the hierarchy. ben@chromium.org2011-05-1312-188/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Widget ---- Now recognizes a supplied NativeWidget via InitParams. If this is specified then a default one is not created. Is now created directly rather than using a factory. NativeWidget creation is not performed until Init() is called. This means some functions that rely on a NativeWidget must not be called until _AFTER_ Init() (explains some of the function call reordering in this CL, e.g. moving SetOpacity() until after Init()). ResetLastMouseMovedFlag() moved to this API so that BaseTabStrip can call it in a cross-platform way. Made last remaining unimplemented methods on Widget pass-thru to NativeWidget implementations. * WidgetWin/WidgetGtk ---- The NativeWidget implementations now both require a NativeWidgetDelegate implementation upon construction. This is passed through the constructor by the static factory method NativeWidget::CreateNativeWidget and by subclasses such as WindowWin, BubbleWidgetWin, etc. Some classes that are constructed directly (e.g. LockWindow, in ChromeOS) never have a Widget created for them, so they create the Widget themselves in their base class initializer. Code in these classes (and their WindowWin/WindowGtk, BrowserFrameWin, BrowserFrameGtk subclasses) must now call GetWidget() etc to call Widget API methods since they are no longer subclasses. static_casting to this (and derived) types must now be done on the Widget's native_widget(). GetWindow() is renamed to GetContainingWindow() to avoid naming conflicts. * Window ---- Window is now a subclass of Widget. Now recognizes a supplied NativeWindow via InitParams. If this is specified then a default one is not created. Window::CloseWindow becomes an override of Widget::Close. CloseAllSecondaryWindows() becomes CloseAllSecondaryWidgets() and moves to widget.h IsAppWindow() is removed and replaced by set_is_secondary_widget on Widget. * MenuHost ---- Subclasses Widget now. * TabContentsViewViews ---- It looks like the Gtk-views code here was still using the old implementation of the Native version of this class - i.e. a class that subclassed TabContentsView AND WidgetGtk. A no-no. I had to write NativeTabContentsViewGtk, which is almost identical to NativeTabContentsViewWin with the Gtk bits of TabContentsViewGtk thrown in. * BrowserFrame ---- Platform-specific functionality is now restricted to BrowserFrameWin/BrowserFrameGtk behind a NativeBrowserFrame interface. Construction is exposed via a static factory method on NativeBrowserFrame. BrowserFrame becomes a concrete class that now subclasses Window. As a result, it no longer needs a GetWindow() accessor method, so people with a BrowserFrame* can just call Window methods directly on it. It is constructed directly, replacing the BrowserFrame::Create() method. NativeBrowserFrameDelegate is no longer needed. BrowserFrameChromeos is simpler as a couple of #ifdefs in BrowserFrame, so I got rid of that too. * AutocompletePopupWin/Gtk ---- No longer required. AutocompletePopupContentsView now just uses a Widget directly. * There is some lingering ugliness: - If you set a native_window field on Window::InitParams you must also manually set widget_init_params.native_widget. I will make InitParams do more of this automatically later. - It'd be nice for the ContentsView to be specified via InitParams. I'll get to this later. - NativeBrowserFrame could probably disappear as an interface. It only exists to provide a couple of methods that may be implemented in other ways. - delete_on_destroy should now be an ownership directionality enum. I will do this later. - Secondary-widgetness should somehow be inferred from transience. Later. - set_focus_on_creation for both the NativeWidgets should probably move to Widget if it is really needed. - WidgetWin/Gtk::SetInitialFocus seems like it could move to Widget. - I need to clean up function order in some cases. BUG=72040 TEST=none Review URL: http://codereview.chromium.org/7012006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85269 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 85257 - Removing DeleteSoon() from WigetGtk so it behaves like WidgetWinglotov@google.com2011-05-132-4/+0
| | | | | | | | | | | | | This is a retry of http://codereview.chromium.org/7002029/ after it has been reverted because of the failing test BrowserTest.CloseWithAppMenuOpen (failed only on buildbot) BUG=chromium-os:15129 TEST=tests TBR=dpolukhin TBR=glotov@google.com Review URL: http://codereview.chromium.org/7016033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85262 0039d316-1c4b-4281-b951-d872f2087c98
* Removing DeleteSoon() from WigetGtk so it behaves like WidgetWinglotov@google.com2011-05-132-0/+4
| | | | | | | | | | This is a retry of http://codereview.chromium.org/7002029/ after it has been reverted because of the failing test BrowserTest.CloseWithAppMenuOpen (failed only on buildbot) BUG=chromium-os:15129 TEST=tests TBR=dpolukhin git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85257 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 85120 - Removing DeleteSoon() from WigetGtk so it behaves like WidgetWinglotov@google.com2011-05-122-4/+0
| | | | | | | | | | | | BUG=chromium-os:15129 TEST=tests Review URL: http://codereview.chromium.org/7002029 TBR=glotov@google.com Review URL: http://codereview.chromium.org/7016017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85127 0039d316-1c4b-4281-b951-d872f2087c98