| 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/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar_view.h" |
| 6 | 6 |
| 7 #include "base/i18n/number_formatting.h" | 7 #include "base/i18n/number_formatting.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 case IDC_CUT: | 494 case IDC_CUT: |
| 495 *accelerator = ui::Accelerator(ui::VKEY_X, ui::EF_CONTROL_DOWN); | 495 *accelerator = ui::Accelerator(ui::VKEY_X, ui::EF_CONTROL_DOWN); |
| 496 return true; | 496 return true; |
| 497 case IDC_COPY: | 497 case IDC_COPY: |
| 498 *accelerator = ui::Accelerator(ui::VKEY_C, ui::EF_CONTROL_DOWN); | 498 *accelerator = ui::Accelerator(ui::VKEY_C, ui::EF_CONTROL_DOWN); |
| 499 return true; | 499 return true; |
| 500 case IDC_PASTE: | 500 case IDC_PASTE: |
| 501 *accelerator = ui::Accelerator(ui::VKEY_V, ui::EF_CONTROL_DOWN); | 501 *accelerator = ui::Accelerator(ui::VKEY_V, ui::EF_CONTROL_DOWN); |
| 502 return true; | 502 return true; |
| 503 #if defined(USE_ASH) | 503 #if defined(USE_ASH) |
| 504 // When USE_ASH is defined, IDC_NEW_WINDOW and IDC_NEW_INCOGNITO_WINDOW are | 504 // When USE_ASH is defined, the commands listed here are handled outside |
| 505 // handled outside Chrome, in ash/accelerators/accelerator_table.cc. | 505 // Chrome, in ash/accelerators/accelerator_table.cc (crbug.com/120196). |
| 506 // crbug.com/120196 | 506 case IDC_CLEAR_BROWSING_DATA: |
| 507 *accelerator = ui::Accelerator(ui::VKEY_BACK, |
| 508 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); |
| 509 return true; |
| 510 case IDC_NEW_TAB: |
| 511 *accelerator = ui::Accelerator(ui::VKEY_T, ui::EF_CONTROL_DOWN); |
| 512 return true; |
| 507 case IDC_NEW_WINDOW: | 513 case IDC_NEW_WINDOW: |
| 508 *accelerator = ui::Accelerator(ui::VKEY_N, ui::EF_CONTROL_DOWN); | 514 *accelerator = ui::Accelerator(ui::VKEY_N, ui::EF_CONTROL_DOWN); |
| 509 return true; | 515 return true; |
| 510 case IDC_NEW_INCOGNITO_WINDOW: | 516 case IDC_NEW_INCOGNITO_WINDOW: |
| 511 *accelerator = ui::Accelerator(ui::VKEY_N, | 517 *accelerator = ui::Accelerator(ui::VKEY_N, |
| 512 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); | 518 ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); |
| 513 return true; | 519 return true; |
| 520 case IDC_TASK_MANAGER: |
| 521 *accelerator = ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN); |
| 522 return true; |
| 514 #endif | 523 #endif |
| 515 } | 524 } |
| 516 // Else, we retrieve the accelerator information from the frame. | 525 // Else, we retrieve the accelerator information from the frame. |
| 517 return GetWidget()->GetAccelerator(command_id, accelerator); | 526 return GetWidget()->GetAccelerator(command_id, accelerator); |
| 518 } | 527 } |
| 519 | 528 |
| 520 //////////////////////////////////////////////////////////////////////////////// | 529 //////////////////////////////////////////////////////////////////////////////// |
| 521 // ToolbarView, views::View overrides: | 530 // ToolbarView, views::View overrides: |
| 522 | 531 |
| 523 gfx::Size ToolbarView::GetPreferredSize() { | 532 gfx::Size ToolbarView::GetPreferredSize() { |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 accname_app = l10n_util::GetStringFUTF16( | 818 accname_app = l10n_util::GetStringFUTF16( |
| 810 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); | 819 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); |
| 811 } | 820 } |
| 812 app_menu_->SetAccessibleName(accname_app); | 821 app_menu_->SetAccessibleName(accname_app); |
| 813 | 822 |
| 814 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL)); | 823 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL)); |
| 815 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT)); | 824 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT)); |
| 816 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED)); | 825 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED)); |
| 817 SchedulePaint(); | 826 SchedulePaint(); |
| 818 } | 827 } |
| OLD | NEW |