| OLD | NEW |
| 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 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 2134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2145 } | 2145 } |
| 2146 | 2146 |
| 2147 // We don't need the Windows accelerator table anymore. | 2147 // We don't need the Windows accelerator table anymore. |
| 2148 free(accelerators); | 2148 free(accelerators); |
| 2149 #else | 2149 #else |
| 2150 views::FocusManager* focus_manager = GetFocusManager(); | 2150 views::FocusManager* focus_manager = GetFocusManager(); |
| 2151 DCHECK(focus_manager); | 2151 DCHECK(focus_manager); |
| 2152 // Let's fill our own accelerator table. | 2152 // Let's fill our own accelerator table. |
| 2153 for (size_t i = 0; i < browser::kAcceleratorMapLength; ++i) { | 2153 for (size_t i = 0; i < browser::kAcceleratorMapLength; ++i) { |
| 2154 ui::Accelerator accelerator(browser::kAcceleratorMap[i].keycode, | 2154 ui::Accelerator accelerator(browser::kAcceleratorMap[i].keycode, |
| 2155 browser::kAcceleratorMap[i].shift_pressed, | 2155 browser::kAcceleratorMap[i].modifiers); |
| 2156 browser::kAcceleratorMap[i].ctrl_pressed, | |
| 2157 browser::kAcceleratorMap[i].alt_pressed); | |
| 2158 accelerator_table_[accelerator] = browser::kAcceleratorMap[i].command_id; | 2156 accelerator_table_[accelerator] = browser::kAcceleratorMap[i].command_id; |
| 2159 | 2157 |
| 2160 // Also register with the focus manager. | 2158 // Also register with the focus manager. |
| 2161 focus_manager->RegisterAccelerator( | 2159 focus_manager->RegisterAccelerator( |
| 2162 accelerator, ui::AcceleratorManager::kNormalPriority, this); | 2160 accelerator, ui::AcceleratorManager::kNormalPriority, this); |
| 2163 } | 2161 } |
| 2164 #endif | 2162 #endif |
| 2165 } | 2163 } |
| 2166 | 2164 |
| 2167 int BrowserView::GetCommandIDForAppCommandID(int app_command_id) const { | 2165 int BrowserView::GetCommandIDForAppCommandID(int app_command_id) const { |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2399 return; | 2397 return; |
| 2400 | 2398 |
| 2401 PasswordGenerationBubbleView* bubble = | 2399 PasswordGenerationBubbleView* bubble = |
| 2402 new PasswordGenerationBubbleView(bounds, | 2400 new PasswordGenerationBubbleView(bounds, |
| 2403 this, | 2401 this, |
| 2404 web_contents->GetRenderViewHost()); | 2402 web_contents->GetRenderViewHost()); |
| 2405 views::BubbleDelegateView::CreateBubble(bubble); | 2403 views::BubbleDelegateView::CreateBubble(bubble); |
| 2406 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2404 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
| 2407 bubble->Show(); | 2405 bubble->Show(); |
| 2408 } | 2406 } |
| OLD | NEW |