OLD | NEW |
| (Empty) |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/base/accelerators/accelerator.h" | |
6 #include "chrome/browser/profiles/profile.h" | |
7 #include "chrome/browser/ui/browser.h" | |
8 #include "chrome/browser/ui/browser_finder.h" | |
9 #include "chrome/browser/ui/views/frame/browser_view.h" | |
10 | |
11 namespace chrome { | |
12 | |
13 bool IsChromeAccelerator(const ui::Accelerator& accelerator, Profile* profile) { | |
14 Browser* browser = chrome::FindLastActiveWithProfile( | |
15 profile, chrome::HOST_DESKTOP_TYPE_NATIVE); | |
16 if (!browser) | |
17 return false; | |
18 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( | |
19 browser->window()->GetNativeWindow()); | |
20 return browser_view->IsAcceleratorRegistered(accelerator); | |
21 } | |
22 | |
23 } // namespace chrome | |
OLD | NEW |