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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 !home_page_is_new_tab_page_.IsManaged()); | 619 !home_page_is_new_tab_page_.IsManaged()); |
620 } | 620 } |
621 | 621 |
622 bool BrowserToolbarGtk::ShouldOnlyShowLocation() const { | 622 bool BrowserToolbarGtk::ShouldOnlyShowLocation() const { |
623 // If we're a popup window, only show the location bar (omnibox). | 623 // If we're a popup window, only show the location bar (omnibox). |
624 return browser_->type() != Browser::TYPE_NORMAL; | 624 return browser_->type() != Browser::TYPE_NORMAL; |
625 } | 625 } |
626 | 626 |
627 gboolean BrowserToolbarGtk::OnWrenchMenuButtonExpose(GtkWidget* sender, | 627 gboolean BrowserToolbarGtk::OnWrenchMenuButtonExpose(GtkWidget* sender, |
628 GdkEventExpose* expose) { | 628 GdkEventExpose* expose) { |
629 if (!Singleton<UpgradeDetector>::get()->notify_upgrade()) | 629 if (!UpgradeDetector::GetInstance()->notify_upgrade()) |
630 return FALSE; | 630 return FALSE; |
631 | 631 |
632 const SkBitmap& badge = | 632 const SkBitmap& badge = |
633 *theme_provider_->GetBitmapNamed(IDR_UPDATE_BADGE); | 633 *theme_provider_->GetBitmapNamed(IDR_UPDATE_BADGE); |
634 | 634 |
635 // Draw the chrome app menu icon onto the canvas. | 635 // Draw the chrome app menu icon onto the canvas. |
636 gfx::CanvasSkiaPaint canvas(expose, false); | 636 gfx::CanvasSkiaPaint canvas(expose, false); |
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 |