Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1305)

Unified Diff: chrome/browser/extensions/extension_host.cc

Issue 415001: Merge 32335... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/views/browser_actions_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_host.cc
===================================================================
--- chrome/browser/extensions/extension_host.cc (revision 32528)
+++ chrome/browser/extensions/extension_host.cc (working copy)
@@ -8,6 +8,7 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
+#include "base/keyboard_codes.h"
#include "base/message_loop.h"
#include "base/singleton.h"
#include "base/string_util.h"
@@ -537,6 +538,14 @@
}
void ExtensionHost::GotFocus() {
+#if defined(TOOLKIT_VIEWS)
+ // Request focus so that the FocusManager has a focused view and can perform
+ // normally its key event processing (so that it lets tab key events go to the
+ // renderer).
+ view()->RequestFocus();
+#else
+ // TODO(port)
+#endif
}
void ExtensionHost::TakeFocus(bool reverse) {
@@ -547,6 +556,14 @@
}
bool ExtensionHost::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
+ if (extension_host_type_ == ViewType::EXTENSION_POPUP &&
+ event.windowsKeyCode == base::VKEY_ESCAPE) {
+ NotificationService::current()->Notify(
+ NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE,
+ Source<Profile>(profile_),
+ Details<ExtensionHost>(this));
+ return true;
+ }
return false;
}
« no previous file with comments | « no previous file | chrome/browser/views/browser_actions_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698