| OLD | NEW |
| 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 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 if (ash_util::IsAcceleratorDeprecated(accelerator)) { | 1346 if (ash_util::IsAcceleratorDeprecated(accelerator)) { |
| 1347 return (event.type() == blink::WebInputEvent::RawKeyDown) | 1347 return (event.type() == blink::WebInputEvent::RawKeyDown) |
| 1348 ? content::KeyboardEventProcessingResult::NOT_HANDLED_IS_SHORTCUT | 1348 ? content::KeyboardEventProcessingResult::NOT_HANDLED_IS_SHORTCUT |
| 1349 : content::KeyboardEventProcessingResult::NOT_HANDLED; | 1349 : content::KeyboardEventProcessingResult::NOT_HANDLED; |
| 1350 } | 1350 } |
| 1351 #endif // defined(OS_CHROMEOS) | 1351 #endif // defined(OS_CHROMEOS) |
| 1352 | 1352 |
| 1353 if (frame_->PreHandleKeyboardEvent(event)) | 1353 if (frame_->PreHandleKeyboardEvent(event)) |
| 1354 return content::KeyboardEventProcessingResult::HANDLED; | 1354 return content::KeyboardEventProcessingResult::HANDLED; |
| 1355 | 1355 |
| 1356 #if defined(OS_CHROMEOS) |
| 1357 if (event.os_event && event.os_event->IsKeyEvent() && |
| 1358 ash_util::WillAshProcessAcceleratorForEvent( |
| 1359 *event.os_event->AsKeyEvent())) { |
| 1360 return content::KeyboardEventProcessingResult::HANDLED_DONT_UPDATE_EVENT; |
| 1361 } |
| 1362 #endif |
| 1363 |
| 1356 chrome::BrowserCommandController* controller = browser_->command_controller(); | 1364 chrome::BrowserCommandController* controller = browser_->command_controller(); |
| 1357 | 1365 |
| 1358 // Here we need to retrieve the command id (if any) associated to the | 1366 // Here we need to retrieve the command id (if any) associated to the |
| 1359 // keyboard event. Instead of looking up the command id in the | 1367 // keyboard event. Instead of looking up the command id in the |
| 1360 // |accelerator_table_| by ourselves, we block the command execution of | 1368 // |accelerator_table_| by ourselves, we block the command execution of |
| 1361 // the |browser_| object then send the keyboard event to the | 1369 // the |browser_| object then send the keyboard event to the |
| 1362 // |focus_manager| as if we are activating an accelerator key. | 1370 // |focus_manager| as if we are activating an accelerator key. |
| 1363 // Then we can retrieve the command id from the |browser_| object. | 1371 // Then we can retrieve the command id from the |browser_| object. |
| 1364 bool original_block_command_state = controller->block_command_execution(); | 1372 bool original_block_command_state = controller->block_command_execution(); |
| 1365 controller->SetBlockCommandExecution(true); | 1373 controller->SetBlockCommandExecution(true); |
| (...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2676 } | 2684 } |
| 2677 | 2685 |
| 2678 extensions::ActiveTabPermissionGranter* | 2686 extensions::ActiveTabPermissionGranter* |
| 2679 BrowserView::GetActiveTabPermissionGranter() { | 2687 BrowserView::GetActiveTabPermissionGranter() { |
| 2680 content::WebContents* web_contents = GetActiveWebContents(); | 2688 content::WebContents* web_contents = GetActiveWebContents(); |
| 2681 if (!web_contents) | 2689 if (!web_contents) |
| 2682 return nullptr; | 2690 return nullptr; |
| 2683 return extensions::TabHelper::FromWebContents(web_contents) | 2691 return extensions::TabHelper::FromWebContents(web_contents) |
| 2684 ->active_tab_permission_granter(); | 2692 ->active_tab_permission_granter(); |
| 2685 } | 2693 } |
| OLD | NEW |