| 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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 switch (command_id) { | 483 switch (command_id) { |
| 484 case IDC_CUT: | 484 case IDC_CUT: |
| 485 *accelerator = ui::Accelerator(ui::VKEY_X, false, true, false); | 485 *accelerator = ui::Accelerator(ui::VKEY_X, false, true, false); |
| 486 return true; | 486 return true; |
| 487 case IDC_COPY: | 487 case IDC_COPY: |
| 488 *accelerator = ui::Accelerator(ui::VKEY_C, false, true, false); | 488 *accelerator = ui::Accelerator(ui::VKEY_C, false, true, false); |
| 489 return true; | 489 return true; |
| 490 case IDC_PASTE: | 490 case IDC_PASTE: |
| 491 *accelerator = ui::Accelerator(ui::VKEY_V, false, true, false); | 491 *accelerator = ui::Accelerator(ui::VKEY_V, false, true, false); |
| 492 return true; | 492 return true; |
| 493 #if defined(USE_ASH) |
| 494 // When USE_ASH is defined, IDC_NEW_WINDOW and IDC_NEW_INCOGNITO_WINDOW are |
| 495 // handled outside Chrome, in ash/accelerators/accelerator_table.cc. |
| 496 // crbug.com/120196 |
| 497 case IDC_NEW_WINDOW: |
| 498 *accelerator = ui::Accelerator(ui::VKEY_N, false, true, false); |
| 499 return true; |
| 500 case IDC_NEW_INCOGNITO_WINDOW: |
| 501 *accelerator = ui::Accelerator(ui::VKEY_N, true, true, false); |
| 502 return true; |
| 503 #endif |
| 493 } | 504 } |
| 494 // Else, we retrieve the accelerator information from the frame. | 505 // Else, we retrieve the accelerator information from the frame. |
| 495 return GetWidget()->GetAccelerator(command_id, accelerator); | 506 return GetWidget()->GetAccelerator(command_id, accelerator); |
| 496 } | 507 } |
| 497 | 508 |
| 498 //////////////////////////////////////////////////////////////////////////////// | 509 //////////////////////////////////////////////////////////////////////////////// |
| 499 // ToolbarView, views::View overrides: | 510 // ToolbarView, views::View overrides: |
| 500 | 511 |
| 501 gfx::Size ToolbarView::GetPreferredSize() { | 512 gfx::Size ToolbarView::GetPreferredSize() { |
| 502 if (IsDisplayModeNormal()) { | 513 if (IsDisplayModeNormal()) { |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 accname_app = l10n_util::GetStringFUTF16( | 794 accname_app = l10n_util::GetStringFUTF16( |
| 784 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); | 795 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); |
| 785 } | 796 } |
| 786 app_menu_->SetAccessibleName(accname_app); | 797 app_menu_->SetAccessibleName(accname_app); |
| 787 | 798 |
| 788 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL)); | 799 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL)); |
| 789 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT)); | 800 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT)); |
| 790 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED)); | 801 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED)); |
| 791 SchedulePaint(); | 802 SchedulePaint(); |
| 792 } | 803 } |
| OLD | NEW |