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 <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <X11/XF86keysym.h> | 9 #include <X11/XF86keysym.h> |
10 | 10 |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 void BrowserToolbarGtk::OnButtonClick(GtkWidget* button, | 619 void BrowserToolbarGtk::OnButtonClick(GtkWidget* button, |
620 BrowserToolbarGtk* toolbar) { | 620 BrowserToolbarGtk* toolbar) { |
621 if ((button == toolbar->back_->widget()) || | 621 if ((button == toolbar->back_->widget()) || |
622 (button == toolbar->forward_->widget())) { | 622 (button == toolbar->forward_->widget())) { |
623 toolbar->location_bar_->Revert(); | 623 toolbar->location_bar_->Revert(); |
624 return; | 624 return; |
625 } | 625 } |
626 | 626 |
627 int tag = -1; | 627 int tag = -1; |
628 if (button == toolbar->reload_->widget()) { | 628 if (button == toolbar->reload_->widget()) { |
629 tag = IDC_RELOAD; | 629 GdkModifierType modifier_state; |
| 630 if (gtk_get_current_event_state(&modifier_state) && |
| 631 modifier_state & GDK_SHIFT_MASK) { |
| 632 tag = IDC_RELOAD_IGNORING_CACHE; |
| 633 } else { |
| 634 tag = IDC_RELOAD; |
| 635 } |
630 toolbar->location_bar_->Revert(); | 636 toolbar->location_bar_->Revert(); |
631 } else if (toolbar->home_.get() && button == toolbar->home_->widget()) { | 637 } else if (toolbar->home_.get() && button == toolbar->home_->widget()) { |
632 tag = IDC_HOME; | 638 tag = IDC_HOME; |
633 } else if (button == toolbar->star_->widget()) { | 639 } else if (button == toolbar->star_->widget()) { |
634 tag = IDC_BOOKMARK_PAGE; | 640 tag = IDC_BOOKMARK_PAGE; |
635 } | 641 } |
636 | 642 |
637 DCHECK_NE(tag, -1) << "Unexpected button click callback"; | 643 DCHECK_NE(tag, -1) << "Unexpected button click callback"; |
638 toolbar->browser_->ExecuteCommandWithDisposition(tag, | 644 toolbar->browser_->ExecuteCommandWithDisposition(tag, |
639 gtk_util::DispositionForCurrentButtonPressEvent()); | 645 gtk_util::DispositionForCurrentButtonPressEvent()); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 menu->PopupAsFromKeyEvent(button); | 726 menu->PopupAsFromKeyEvent(button); |
721 menu_bar_helper_.MenuStartedShowing(button, menu->widget()); | 727 menu_bar_helper_.MenuStartedShowing(button, menu->widget()); |
722 } | 728 } |
723 | 729 |
724 void BrowserToolbarGtk::PopupForButtonNextTo(GtkWidget* button, | 730 void BrowserToolbarGtk::PopupForButtonNextTo(GtkWidget* button, |
725 GtkMenuDirectionType dir) { | 731 GtkMenuDirectionType dir) { |
726 GtkWidget* other_button = button == page_menu_button_.get() ? | 732 GtkWidget* other_button = button == page_menu_button_.get() ? |
727 app_menu_button_.get() : page_menu_button_.get(); | 733 app_menu_button_.get() : page_menu_button_.get(); |
728 PopupForButton(other_button); | 734 PopupForButton(other_button); |
729 } | 735 } |
OLD | NEW |