| 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/gtk/browser_toolbar_gtk.h" | 5 #include "chrome/browser/gtk/browser_toolbar_gtk.h" |
| 6 | 6 |
| 7 #include <X11/XF86keysym.h> | 7 #include <X11/XF86keysym.h> |
| 8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 bool BrowserToolbarGtk::AlwaysShowIconForCmd(int command_id) const { | 322 bool BrowserToolbarGtk::AlwaysShowIconForCmd(int command_id) const { |
| 323 return command_id == IDC_UPGRADE_DIALOG; | 323 return command_id == IDC_UPGRADE_DIALOG; |
| 324 } | 324 } |
| 325 | 325 |
| 326 // menus::AcceleratorProvider | 326 // menus::AcceleratorProvider |
| 327 | 327 |
| 328 bool BrowserToolbarGtk::GetAcceleratorForCommandId( | 328 bool BrowserToolbarGtk::GetAcceleratorForCommandId( |
| 329 int id, | 329 int id, |
| 330 menus::Accelerator* accelerator) { | 330 menus::Accelerator* accelerator) { |
| 331 const menus::AcceleratorGtk* accelerator_gtk = | 331 const menus::AcceleratorGtk* accelerator_gtk = |
| 332 Singleton<AcceleratorsGtk>()->GetPrimaryAcceleratorForCommand(id); | 332 AcceleratorsGtk::GetInstance()->GetPrimaryAcceleratorForCommand(id); |
| 333 if (accelerator_gtk) | 333 if (accelerator_gtk) |
| 334 *accelerator = *accelerator_gtk; | 334 *accelerator = *accelerator_gtk; |
| 335 return !!accelerator_gtk; | 335 return !!accelerator_gtk; |
| 336 } | 336 } |
| 337 | 337 |
| 338 // NotificationObserver -------------------------------------------------------- | 338 // NotificationObserver -------------------------------------------------------- |
| 339 | 339 |
| 340 void BrowserToolbarGtk::Observe(NotificationType type, | 340 void BrowserToolbarGtk::Observe(NotificationType type, |
| 341 const NotificationSource& source, | 341 const NotificationSource& source, |
| 342 const NotificationDetails& details) { | 342 const NotificationDetails& details) { |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 int x_offset = base::i18n::IsRTL() ? 0 : | 637 int x_offset = base::i18n::IsRTL() ? 0 : |
| 638 sender->allocation.width - badge.width(); | 638 sender->allocation.width - badge.width(); |
| 639 int y_offset = 0; | 639 int y_offset = 0; |
| 640 canvas.DrawBitmapInt( | 640 canvas.DrawBitmapInt( |
| 641 badge, | 641 badge, |
| 642 sender->allocation.x + x_offset, | 642 sender->allocation.x + x_offset, |
| 643 sender->allocation.y + y_offset); | 643 sender->allocation.y + y_offset); |
| 644 | 644 |
| 645 return FALSE; | 645 return FALSE; |
| 646 } | 646 } |
| OLD | NEW |