1cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
20f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
30f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)// found in the LICENSE file.
40f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)
5cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "chrome/browser/chromeos/login/ui/keyboard_driven_oobe_key_handler.h"
60f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)
70f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)#include "ash/shell.h"
80f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)#include "ash/system/tray/system_tray.h"
90f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)
100f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)namespace chromeos {
110f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)
120f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)KeyboardDrivenOobeKeyHandler::KeyboardDrivenOobeKeyHandler() {
130f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)  ash::Shell::GetInstance()->AddPreTargetHandler(this);
140f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)}
150f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)KeyboardDrivenOobeKeyHandler::~KeyboardDrivenOobeKeyHandler() {
160f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)  ash::Shell::GetInstance()->RemovePreTargetHandler(this);
170f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)}
180f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)
190f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)void KeyboardDrivenOobeKeyHandler::OnKeyEvent(ui::KeyEvent* event) {
200f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)  if (event->key_code() == ui::VKEY_F6) {
210f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)    ash::Shell::GetInstance()->GetPrimarySystemTray()->CloseSystemBubble();
220f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)    event->StopPropagation();
230f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)  }
240f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)}
250f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)
260f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)}  // namespace chromeos
27