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

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

Issue 2128243003: Make most browser accelerators not repeat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comment in test Created 4 years, 3 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after
2010 2010
2011 /////////////////////////////////////////////////////////////////////////////// 2011 ///////////////////////////////////////////////////////////////////////////////
2012 // BrowserView, ui::AcceleratorTarget overrides: 2012 // BrowserView, ui::AcceleratorTarget overrides:
2013 2013
2014 bool BrowserView::AcceleratorPressed(const ui::Accelerator& accelerator) { 2014 bool BrowserView::AcceleratorPressed(const ui::Accelerator& accelerator) {
2015 std::map<ui::Accelerator, int>::const_iterator iter = 2015 std::map<ui::Accelerator, int>::const_iterator iter =
2016 accelerator_table_.find(accelerator); 2016 accelerator_table_.find(accelerator);
2017 DCHECK(iter != accelerator_table_.end()); 2017 DCHECK(iter != accelerator_table_.end());
2018 int command_id = iter->second; 2018 int command_id = iter->second;
2019 2019
2020 if (accelerator.IsRepeat() && !chrome::IsCommandRepeatable(command_id))
2021 return false;
2022
2020 chrome::BrowserCommandController* controller = browser_->command_controller(); 2023 chrome::BrowserCommandController* controller = browser_->command_controller();
2021 if (!controller->block_command_execution()) 2024 if (!controller->block_command_execution())
2022 UpdateAcceleratorMetrics(accelerator, command_id); 2025 UpdateAcceleratorMetrics(accelerator, command_id);
2023 return chrome::ExecuteCommand(browser_.get(), command_id); 2026 return chrome::ExecuteCommand(browser_.get(), command_id);
2024 } 2027 }
2025 2028
2026 /////////////////////////////////////////////////////////////////////////////// 2029 ///////////////////////////////////////////////////////////////////////////////
2027 // BrowserView, OmniboxPopupModelObserver overrides: 2030 // BrowserView, OmniboxPopupModelObserver overrides:
2028 void BrowserView::OnOmniboxPopupShownOrHidden() { 2031 void BrowserView::OnOmniboxPopupShownOrHidden() {
2029 SetMaxTopArrowHeight(GetMaxTopInfoBarArrowHeight(), infobar_container_); 2032 SetMaxTopArrowHeight(GetMaxTopInfoBarArrowHeight(), infobar_container_);
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
2665 } 2668 }
2666 2669
2667 extensions::ActiveTabPermissionGranter* 2670 extensions::ActiveTabPermissionGranter*
2668 BrowserView::GetActiveTabPermissionGranter() { 2671 BrowserView::GetActiveTabPermissionGranter() {
2669 content::WebContents* web_contents = GetActiveWebContents(); 2672 content::WebContents* web_contents = GetActiveWebContents();
2670 if (!web_contents) 2673 if (!web_contents)
2671 return nullptr; 2674 return nullptr;
2672 return extensions::TabHelper::FromWebContents(web_contents) 2675 return extensions::TabHelper::FromWebContents(web_contents)
2673 ->active_tab_permission_granter(); 2676 ->active_tab_permission_granter();
2674 } 2677 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/frame/browser_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698