| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/toolbar_view.h" | 5 #include "chrome/browser/views/toolbar_view.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "chrome/app/chrome_dll_resource.h" | 9 #include "chrome/app/chrome_dll_resource.h" |
| 10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 //////////////////////////////////////////////////////////////////////////////// | 346 //////////////////////////////////////////////////////////////////////////////// |
| 347 // ToolbarView, menus::AcceleratorProvider implementation: | 347 // ToolbarView, menus::AcceleratorProvider implementation: |
| 348 | 348 |
| 349 bool ToolbarView::GetAcceleratorForCommandId(int command_id, | 349 bool ToolbarView::GetAcceleratorForCommandId(int command_id, |
| 350 menus::Accelerator* accelerator) { | 350 menus::Accelerator* accelerator) { |
| 351 // The standard Ctrl-X, Ctrl-V and Ctrl-C are not defined as accelerators | 351 // The standard Ctrl-X, Ctrl-V and Ctrl-C are not defined as accelerators |
| 352 // anywhere so we need to check for them explicitly here. | 352 // anywhere so we need to check for them explicitly here. |
| 353 // TODO(cpu) Bug 1109102. Query WebKit land for the actual bindings. | 353 // TODO(cpu) Bug 1109102. Query WebKit land for the actual bindings. |
| 354 switch (command_id) { | 354 switch (command_id) { |
| 355 case IDC_CUT: | 355 case IDC_CUT: |
| 356 *accelerator = views::Accelerator(app::VKEY_X, false, true, false); | 356 *accelerator = views::Accelerator(base::VKEY_X, false, true, false); |
| 357 return true; | 357 return true; |
| 358 case IDC_COPY: | 358 case IDC_COPY: |
| 359 *accelerator = views::Accelerator(app::VKEY_C, false, true, false); | 359 *accelerator = views::Accelerator(base::VKEY_C, false, true, false); |
| 360 return true; | 360 return true; |
| 361 case IDC_PASTE: | 361 case IDC_PASTE: |
| 362 *accelerator = views::Accelerator(app::VKEY_V, false, true, false); | 362 *accelerator = views::Accelerator(base::VKEY_V, false, true, false); |
| 363 return true; | 363 return true; |
| 364 } | 364 } |
| 365 // Else, we retrieve the accelerator information from the frame. | 365 // Else, we retrieve the accelerator information from the frame. |
| 366 return GetWidget()->GetAccelerator(command_id, accelerator); | 366 return GetWidget()->GetAccelerator(command_id, accelerator); |
| 367 } | 367 } |
| 368 | 368 |
| 369 //////////////////////////////////////////////////////////////////////////////// | 369 //////////////////////////////////////////////////////////////////////////////// |
| 370 // ToolbarView, views::View overrides: | 370 // ToolbarView, views::View overrides: |
| 371 | 371 |
| 372 gfx::Size ToolbarView::GetPreferredSize() { | 372 gfx::Size ToolbarView::GetPreferredSize() { |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 *tp->GetBitmapNamed(IDR_UPGRADE_DOT_ACTIVE), | 619 *tp->GetBitmapNamed(IDR_UPGRADE_DOT_ACTIVE), |
| 620 value); | 620 value); |
| 621 } | 621 } |
| 622 | 622 |
| 623 static const int kBadgeLeftSpacing = 8; | 623 static const int kBadgeLeftSpacing = 8; |
| 624 static const int kBadgeTopSpacing = 18; | 624 static const int kBadgeTopSpacing = 18; |
| 625 canvas->DrawBitmapInt(badge, kBadgeLeftSpacing, kBadgeTopSpacing); | 625 canvas->DrawBitmapInt(badge, kBadgeLeftSpacing, kBadgeTopSpacing); |
| 626 | 626 |
| 627 return canvas->ExtractBitmap(); | 627 return canvas->ExtractBitmap(); |
| 628 } | 628 } |
| OLD | NEW |