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 2424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2435 if (command_id == IDC_BOOKMARK_PAGE) | 2435 if (command_id == IDC_BOOKMARK_PAGE) |
2436 UMA_HISTOGRAM_ENUMERATION("Bookmarks.EntryPoint", | 2436 UMA_HISTOGRAM_ENUMERATION("Bookmarks.EntryPoint", |
2437 BOOKMARK_ENTRY_POINT_ACCELERATOR, | 2437 BOOKMARK_ENTRY_POINT_ACCELERATOR, |
2438 BOOKMARK_ENTRY_POINT_LIMIT); | 2438 BOOKMARK_ENTRY_POINT_LIMIT); |
2439 | 2439 |
2440 #if defined(OS_CHROMEOS) | 2440 #if defined(OS_CHROMEOS) |
2441 // Collect information about the relative popularity of various accelerators | 2441 // Collect information about the relative popularity of various accelerators |
2442 // on Chrome OS. | 2442 // on Chrome OS. |
2443 switch (command_id) { | 2443 switch (command_id) { |
2444 case IDC_BACK: | 2444 case IDC_BACK: |
2445 if (key_code == ui::VKEY_BACK) | 2445 if (key_code == ui::VKEY_BROWSER_BACK) |
2446 content::RecordAction(UserMetricsAction("Accel_Back_Backspace")); | |
2447 else if (key_code == ui::VKEY_BROWSER_BACK) | |
2448 content::RecordAction(UserMetricsAction("Accel_Back_F1")); | 2446 content::RecordAction(UserMetricsAction("Accel_Back_F1")); |
2449 else if (key_code == ui::VKEY_LEFT) | 2447 else if (key_code == ui::VKEY_LEFT) |
2450 content::RecordAction(UserMetricsAction("Accel_Back_Left")); | 2448 content::RecordAction(UserMetricsAction("Accel_Back_Left")); |
2451 break; | 2449 break; |
2452 case IDC_FORWARD: | 2450 case IDC_FORWARD: |
2453 if (key_code == ui::VKEY_BACK) | 2451 if (key_code == ui::VKEY_BROWSER_FORWARD) |
2454 content::RecordAction(UserMetricsAction("Accel_Forward_Backspace")); | |
2455 else if (key_code == ui::VKEY_BROWSER_FORWARD) | |
2456 content::RecordAction(UserMetricsAction("Accel_Forward_F2")); | 2452 content::RecordAction(UserMetricsAction("Accel_Forward_F2")); |
2457 else if (key_code == ui::VKEY_RIGHT) | 2453 else if (key_code == ui::VKEY_RIGHT) |
2458 content::RecordAction(UserMetricsAction("Accel_Forward_Right")); | 2454 content::RecordAction(UserMetricsAction("Accel_Forward_Right")); |
2459 break; | 2455 break; |
2460 case IDC_RELOAD: | 2456 case IDC_RELOAD: |
2461 case IDC_RELOAD_BYPASSING_CACHE: | 2457 case IDC_RELOAD_BYPASSING_CACHE: |
2462 if (key_code == ui::VKEY_R) | 2458 if (key_code == ui::VKEY_R) |
2463 content::RecordAction(UserMetricsAction("Accel_Reload_R")); | 2459 content::RecordAction(UserMetricsAction("Accel_Reload_R")); |
2464 else if (key_code == ui::VKEY_BROWSER_REFRESH) | 2460 else if (key_code == ui::VKEY_BROWSER_REFRESH) |
2465 content::RecordAction(UserMetricsAction("Accel_Reload_F3")); | 2461 content::RecordAction(UserMetricsAction("Accel_Reload_F3")); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2646 } | 2642 } |
2647 | 2643 |
2648 extensions::ActiveTabPermissionGranter* | 2644 extensions::ActiveTabPermissionGranter* |
2649 BrowserView::GetActiveTabPermissionGranter() { | 2645 BrowserView::GetActiveTabPermissionGranter() { |
2650 content::WebContents* web_contents = GetActiveWebContents(); | 2646 content::WebContents* web_contents = GetActiveWebContents(); |
2651 if (!web_contents) | 2647 if (!web_contents) |
2652 return nullptr; | 2648 return nullptr; |
2653 return extensions::TabHelper::FromWebContents(web_contents) | 2649 return extensions::TabHelper::FromWebContents(web_contents) |
2654 ->active_tab_permission_granter(); | 2650 ->active_tab_permission_granter(); |
2655 } | 2651 } |
OLD | NEW |