summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/unhandled_keyboard_event_handler_aurax11.cc
blob: eac8e5e4773e9b1788eb4be2ef382b059dfef5a5 (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
26
// 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/base/events/event.h"
#include "ui/views/focus/focus_manager.h"

using content::NativeWebKeyboardEvent;

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)
    focus_manager->OnKeyEvent(*static_cast<ui::KeyEvent*>(event.os_event));
}