Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: chrome/browser/views/frame/browser_view.cc

Issue 235025: Use windows keycodes under linux (and all non-windows platforms). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/views/frame/browser_view.h" 5 #include "chrome/browser/views/frame/browser_view.h"
6 6
7 #include "app/drag_drop_types.h" 7 #include "app/drag_drop_types.h"
8 #include "app/gfx/canvas.h" 8 #include "app/gfx/canvas.h"
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/os_exchange_data.h" 10 #include "app/os_exchange_data.h"
(...skipping 1990 matching lines...) Expand 10 before | Expand all | Expand 10 after
2001 focus_manager->RegisterAccelerator(accelerator, this); 2001 focus_manager->RegisterAccelerator(accelerator, this);
2002 } 2002 }
2003 2003
2004 // We don't need the Windows accelerator table anymore. 2004 // We don't need the Windows accelerator table anymore.
2005 free(accelerators); 2005 free(accelerators);
2006 #else 2006 #else
2007 views::FocusManager* focus_manager = GetFocusManager(); 2007 views::FocusManager* focus_manager = GetFocusManager();
2008 DCHECK(focus_manager); 2008 DCHECK(focus_manager);
2009 // Let's fill our own accelerator table. 2009 // Let's fill our own accelerator table.
2010 for (size_t i = 0; i < browser::kAcceleratorMapLength; ++i) { 2010 for (size_t i = 0; i < browser::kAcceleratorMapLength; ++i) {
2011 bool alt_down = 2011 views::Accelerator accelerator(browser::kAcceleratorMap[i].keycode,
2012 (browser::kAcceleratorMap[i].modifier_type & GDK_MOD1_MASK) == 2012 browser::kAcceleratorMap[i].shift_pressed,
2013 GDK_MOD1_MASK; 2013 browser::kAcceleratorMap[i].ctrl_pressed,
2014 bool ctrl_down = 2014 browser::kAcceleratorMap[i].alt_pressed);
2015 (browser::kAcceleratorMap[i].modifier_type & GDK_CONTROL_MASK) ==
2016 GDK_CONTROL_MASK;
2017 bool shift_down =
2018 (browser::kAcceleratorMap[i].modifier_type & GDK_SHIFT_MASK) ==
2019 GDK_SHIFT_MASK;
2020 views::Accelerator accelerator(browser::kAcceleratorMap[i].keyval,
2021 shift_down, ctrl_down, alt_down);
2022 accelerator_table_[accelerator] = browser::kAcceleratorMap[i].command_id; 2015 accelerator_table_[accelerator] = browser::kAcceleratorMap[i].command_id;
2023 2016
2024 // Also register with the focus manager. 2017 // Also register with the focus manager.
2025 focus_manager->RegisterAccelerator(accelerator, this); 2018 focus_manager->RegisterAccelerator(accelerator, this);
2026 } 2019 }
2027 #endif 2020 #endif
2028 } 2021 }
2029 2022
2030 #if defined(OS_WIN) 2023 #if defined(OS_WIN)
2031 void BrowserView::BuildSystemMenuForBrowserWindow() { 2024 void BrowserView::BuildSystemMenuForBrowserWindow() {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2173 2166
2174 // static 2167 // static
2175 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2168 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2176 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2169 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2177 } 2170 }
2178 2171
2179 // static 2172 // static
2180 void BrowserList::AllBrowsersClosed() { 2173 void BrowserList::AllBrowsersClosed() {
2181 views::Window::CloseAllSecondaryWindows(); 2174 views::Window::CloseAllSecondaryWindows();
2182 } 2175 }
OLDNEW
« no previous file with comments | « chrome/browser/views/accelerator_table_gtk.cc ('k') | chrome/browser/views/tab_contents/tab_contents_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698