summaryrefslogtreecommitdiffstats
path: root/ui/views/controls
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-24 02:49:31 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-24 02:49:31 +0000
commit3b7fe7a46737a7174abeb21e683f8cd64495247c (patch)
tree885c2001225d1f79e4350fb80c93d5b21d33e742 /ui/views/controls
parent56e0206fd827ede1b464ae2d68a9e7f51e5f50cc (diff)
downloadchromium_src-3b7fe7a46737a7174abeb21e683f8cd64495247c.zip
chromium_src-3b7fe7a46737a7174abeb21e683f8cd64495247c.tar.gz
chromium_src-3b7fe7a46737a7174abeb21e683f8cd64495247c.tar.bz2
Convert the last users of DOMView to WebView.
Remove DOMView. BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/10171006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133615 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls')
-rw-r--r--ui/views/controls/webview/webview.cc6
-rw-r--r--ui/views/controls/webview/webview.h7
2 files changed, 12 insertions, 1 deletions
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc
index b3d8b7c0..eb7846b 100644
--- a/ui/views/controls/webview/webview.cc
+++ b/ui/views/controls/webview/webview.cc
@@ -30,7 +30,8 @@ const char WebView::kViewClassName[] =
WebView::WebView(content::BrowserContext* browser_context)
: wcv_holder_(new NativeViewHost),
web_contents_(NULL),
- browser_context_(browser_context) {
+ browser_context_(browser_context),
+ allow_accelerators_(false) {
AddChildView(wcv_holder_);
}
@@ -98,6 +99,9 @@ void WebView::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
}
bool WebView::SkipDefaultKeyEventProcessing(const views::KeyEvent& event) {
+ if (allow_accelerators_)
+ return FocusManager::IsTabTraversalKeyEvent(event);
+
// Don't look-up accelerators or tab-traversal if we are showing a non-crashed
// TabContents.
// We'll first give the page a chance to process the key events. If it does
diff --git a/ui/views/controls/webview/webview.h b/ui/views/controls/webview/webview.h
index f519c0e..5a73dc9 100644
--- a/ui/views/controls/webview/webview.h
+++ b/ui/views/controls/webview/webview.h
@@ -64,6 +64,12 @@ class VIEWS_EXPORT WebView : public View,
// forward this notification.
void OnWebContentsFocused(content::WebContents* web_contents);
+ // When used to host UI, we need to explicitly allow accelerators to be
+ // processed. Default is false.
+ void set_allow_accelerators(bool allow_accelerators) {
+ allow_accelerators_ = allow_accelerators;
+ }
+
// Overridden from View:
virtual std::string GetClassName() const OVERRIDE;
@@ -101,6 +107,7 @@ class VIEWS_EXPORT WebView : public View,
content::WebContents* web_contents_;
content::BrowserContext* browser_context_;
content::NotificationRegistrar registrar_;
+ bool allow_accelerators_;
DISALLOW_COPY_AND_ASSIGN(WebView);
};