Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / views / accelerator_utils_views.cc
blobc2c77db65bd2fc03d7cbbce70e1445a91961f937
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.
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"
11 namespace chrome {
13 #if !defined(USE_AURA)
15 bool IsChromeAccelerator(const ui::Accelerator& accelerator, Profile* profile) {
16 Browser* browser = chrome::FindLastActiveWithProfile(
17 profile, chrome::HOST_DESKTOP_TYPE_NATIVE);
18 if (!browser)
19 return false;
20 BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(
21 browser->window()->GetNativeWindow());
22 return browser_view->IsAcceleratorRegistered(accelerator);
25 #endif // !USE_AURA
27 } // namespace chrome