summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/unhandled_keyboard_event_handler_gtk.cc
blob: 2980d17e103cc3f275bda1849ecdbd0d1cf15d6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h"

#include "base/logging.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "ui/views/focus/focus_manager.h"

UnhandledKeyboardEventHandler::UnhandledKeyboardEventHandler() {
}

void UnhandledKeyboardEventHandler::HandleKeyboardEvent(
    const NativeWebKeyboardEvent& event,
    views::FocusManager* focus_manager) {
  if (!focus_manager) {
    NOTREACHED();
    return;
  }
  if (event.os_event && !event.skip_in_browser) {
    const views::KeyEvent views_event(event.os_event);
    focus_manager->OnKeyEvent(views_event);
  }
}