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

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

Issue 9402018: Experimental Extension Keybinding (first cut). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #if defined(TOOLKIT_USES_GTK) 7 #if defined(TOOLKIT_USES_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 2252 matching lines...) Expand 10 before | Expand all | Expand 10 after
2263 for (int i = 0; i < count; ++i) { 2263 for (int i = 0; i < count; ++i) {
2264 bool alt_down = (accelerators[i].fVirt & FALT) == FALT; 2264 bool alt_down = (accelerators[i].fVirt & FALT) == FALT;
2265 bool ctrl_down = (accelerators[i].fVirt & FCONTROL) == FCONTROL; 2265 bool ctrl_down = (accelerators[i].fVirt & FCONTROL) == FCONTROL;
2266 bool shift_down = (accelerators[i].fVirt & FSHIFT) == FSHIFT; 2266 bool shift_down = (accelerators[i].fVirt & FSHIFT) == FSHIFT;
2267 ui::Accelerator accelerator( 2267 ui::Accelerator accelerator(
2268 static_cast<ui::KeyboardCode>(accelerators[i].key), 2268 static_cast<ui::KeyboardCode>(accelerators[i].key),
2269 shift_down, ctrl_down, alt_down); 2269 shift_down, ctrl_down, alt_down);
2270 accelerator_table_[accelerator] = accelerators[i].cmd; 2270 accelerator_table_[accelerator] = accelerators[i].cmd;
2271 2271
2272 // Also register with the focus manager. 2272 // Also register with the focus manager.
2273 focus_manager->RegisterAccelerator(accelerator, this); 2273 focus_manager->RegisterAccelerator(
2274 accelerator, ui::AcceleratorManager::kNormalPriority, this);
2274 } 2275 }
2275 2276
2276 // We don't need the Windows accelerator table anymore. 2277 // We don't need the Windows accelerator table anymore.
2277 free(accelerators); 2278 free(accelerators);
2278 #else 2279 #else
2279 views::FocusManager* focus_manager = GetFocusManager(); 2280 views::FocusManager* focus_manager = GetFocusManager();
2280 DCHECK(focus_manager); 2281 DCHECK(focus_manager);
2281 // Let's fill our own accelerator table. 2282 // Let's fill our own accelerator table.
2282 for (size_t i = 0; i < browser::kAcceleratorMapLength; ++i) { 2283 for (size_t i = 0; i < browser::kAcceleratorMapLength; ++i) {
2283 ui::Accelerator accelerator(browser::kAcceleratorMap[i].keycode, 2284 ui::Accelerator accelerator(browser::kAcceleratorMap[i].keycode,
2284 browser::kAcceleratorMap[i].shift_pressed, 2285 browser::kAcceleratorMap[i].shift_pressed,
2285 browser::kAcceleratorMap[i].ctrl_pressed, 2286 browser::kAcceleratorMap[i].ctrl_pressed,
2286 browser::kAcceleratorMap[i].alt_pressed); 2287 browser::kAcceleratorMap[i].alt_pressed);
2287 accelerator_table_[accelerator] = browser::kAcceleratorMap[i].command_id; 2288 accelerator_table_[accelerator] = browser::kAcceleratorMap[i].command_id;
2288 2289
2289 // Also register with the focus manager. 2290 // Also register with the focus manager.
2290 focus_manager->RegisterAccelerator(accelerator, this); 2291 focus_manager->RegisterAccelerator(accelerator, false, this);
2291 } 2292 }
2292 #endif 2293 #endif
2293 } 2294 }
2294 2295
2295 #if defined(OS_WIN) && !defined(USE_AURA) 2296 #if defined(OS_WIN) && !defined(USE_AURA)
2296 void BrowserView::BuildSystemMenuForBrowserWindow() { 2297 void BrowserView::BuildSystemMenuForBrowserWindow() {
2297 system_menu_contents_->AddSeparator(); 2298 system_menu_contents_->AddSeparator();
2298 system_menu_contents_->AddItemWithStringId(IDC_TASK_MANAGER, 2299 system_menu_contents_->AddItemWithStringId(IDC_TASK_MANAGER,
2299 IDS_TASK_MANAGER); 2300 IDS_TASK_MANAGER);
2300 system_menu_contents_->AddSeparator(); 2301 system_menu_contents_->AddSeparator();
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
2562 browser::CreateViewsBubble(bubble); 2563 browser::CreateViewsBubble(bubble);
2563 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); 2564 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE);
2564 bubble->Show(); 2565 bubble->Show();
2565 } 2566 }
2566 2567
2567 void BrowserView::ShowAvatarBubbleFromAvatarButton() { 2568 void BrowserView::ShowAvatarBubbleFromAvatarButton() {
2568 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); 2569 AvatarMenuButton* button = frame_->GetAvatarMenuButton();
2569 if (button) 2570 if (button)
2570 button->ShowAvatarBubble(); 2571 button->ShowAvatarBubble();
2571 } 2572 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/find_bar_host.cc ('k') | chrome/browser/ui/views/location_bar/page_action_image_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698