diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-04 23:59:23 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-04 23:59:23 +0000 |
commit | 3a051a4b8a96fb3edd00ebddcd5eb48e8ecf4396 (patch) | |
tree | 7728a74b027dced0037b18f142329c10954bb7a0 /chrome/browser/dom_ui | |
parent | 23714db12751e6ba10a33a5110359af139d5566c (diff) | |
download | chromium_src-3a051a4b8a96fb3edd00ebddcd5eb48e8ecf4396.zip chromium_src-3a051a4b8a96fb3edd00ebddcd5eb48e8ecf4396.tar.gz chromium_src-3a051a4b8a96fb3edd00ebddcd5eb48e8ecf4396.tar.bz2 |
DOMUI implementation of Menu2.
A few key design points.
* Uses DOMView to render menu content.
* MenuUI (subclass of DOMUI) uses GtkWiget tree to access
WidgetGtk and MenuModel. Alternative way was to change
TabContents::GetDOMUIForCurrentState() public and pass them throught it, but this seems to work fine.
* Input/Focus is controlled by gtk_grab_add. Input is grabbed by the root widget, and then sent to each active menu widget via gtk_grab_add.
* Menu gets shown after the renderer rendered the content
(thus has some size) to avoid showing small/empty menu.
Mouse processing is blocked until the menu is shown (see Dispatcher).
A few issues that will be addressed in separate CL
* RTL (will be after beta)
* menu scroll. working on it now.
* menu sometimes show scroll bar. (I just need to disable it)
* unit test for native_menu_domui
BUG=chromiun-os:6497
TEST=manual for now. all menu2 based meus should work as before (web pages's context menu, system menu, forward/back menu and several chromeos specific one) except for following two:
* mnemonic should work now on context menus.
* menu larger than screen does not scroll. I'll implement this in separate CL
Review URL: http://codereview.chromium.org/3442018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61445 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r-- | chrome/browser/dom_ui/dom_ui_factory.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/chrome/browser/dom_ui/dom_ui_factory.cc b/chrome/browser/dom_ui/dom_ui_factory.cc index 4cc5272..1a70756 100644 --- a/chrome/browser/dom_ui/dom_ui_factory.cc +++ b/chrome/browser/dom_ui/dom_ui_factory.cc @@ -41,6 +41,7 @@ #include "chrome/browser/chromeos/dom_ui/mobile_setup_ui.h" #include "chrome/browser/chromeos/dom_ui/register_page_ui.h" #include "chrome/browser/chromeos/dom_ui/system_info_ui.h" +#include "chrome/browser/chromeos/dom_ui/menu_ui.h" #include "chrome/browser/dom_ui/filebrowse_ui.h" #include "chrome/browser/dom_ui/mediaplayer_ui.h" #endif @@ -163,6 +164,8 @@ static DOMUIFactoryFunction GetDOMUIFactoryFunction(Profile* profile, return &NewDOMUI<SlideshowUI>; if (url.host() == chrome::kChromeUISystemInfoHost) return &NewDOMUI<SystemInfoUI>; + if (url.host() == chrome::kChromeUIMenu) + return &NewDOMUI<chromeos::MenuUI>; #else if (url.host() == chrome::kChromeUISettingsHost) { if (CommandLine::ForCurrentProcess()->HasSwitch( |