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 2122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2133 } | 2133 } |
2134 | 2134 |
2135 // We don't need the Windows accelerator table anymore. | 2135 // We don't need the Windows accelerator table anymore. |
2136 free(accelerators); | 2136 free(accelerators); |
2137 #else | 2137 #else |
2138 views::FocusManager* focus_manager = GetFocusManager(); | 2138 views::FocusManager* focus_manager = GetFocusManager(); |
2139 DCHECK(focus_manager); | 2139 DCHECK(focus_manager); |
2140 // Let's fill our own accelerator table. | 2140 // Let's fill our own accelerator table. |
2141 for (size_t i = 0; i < browser::kAcceleratorMapLength; ++i) { | 2141 for (size_t i = 0; i < browser::kAcceleratorMapLength; ++i) { |
2142 ui::Accelerator accelerator(browser::kAcceleratorMap[i].keycode, | 2142 ui::Accelerator accelerator(browser::kAcceleratorMap[i].keycode, |
2143 browser::kAcceleratorMap[i].shift_pressed, | 2143 browser::kAcceleratorMap[i].modifiers); |
2144 browser::kAcceleratorMap[i].ctrl_pressed, | |
2145 browser::kAcceleratorMap[i].alt_pressed); | |
2146 accelerator_table_[accelerator] = browser::kAcceleratorMap[i].command_id; | 2144 accelerator_table_[accelerator] = browser::kAcceleratorMap[i].command_id; |
2147 | 2145 |
2148 // Also register with the focus manager. | 2146 // Also register with the focus manager. |
2149 focus_manager->RegisterAccelerator( | 2147 focus_manager->RegisterAccelerator( |
2150 accelerator, ui::AcceleratorManager::kNormalPriority, this); | 2148 accelerator, ui::AcceleratorManager::kNormalPriority, this); |
2151 } | 2149 } |
2152 #endif | 2150 #endif |
2153 } | 2151 } |
2154 | 2152 |
2155 int BrowserView::GetCommandIDForAppCommandID(int app_command_id) const { | 2153 int BrowserView::GetCommandIDForAppCommandID(int app_command_id) const { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2387 return; | 2385 return; |
2388 | 2386 |
2389 PasswordGenerationBubbleView* bubble = | 2387 PasswordGenerationBubbleView* bubble = |
2390 new PasswordGenerationBubbleView(bounds, | 2388 new PasswordGenerationBubbleView(bounds, |
2391 this, | 2389 this, |
2392 web_contents->GetRenderViewHost()); | 2390 web_contents->GetRenderViewHost()); |
2393 views::BubbleDelegateView::CreateBubble(bubble); | 2391 views::BubbleDelegateView::CreateBubble(bubble); |
2394 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2392 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
2395 bubble->Show(); | 2393 bubble->Show(); |
2396 } | 2394 } |
OLD | NEW |