| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gtk/reload_button_gtk.h" | 5 #include "chrome/browser/ui/gtk/reload_button_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 guint modifier_state_uint = modifier_state; | 165 guint modifier_state_uint = modifier_state; |
| 166 if (modifier_state_uint & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) { | 166 if (modifier_state_uint & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) { |
| 167 command = IDC_RELOAD_IGNORING_CACHE; | 167 command = IDC_RELOAD_IGNORING_CACHE; |
| 168 // Mask off Shift and Control so they don't affect the disposition below. | 168 // Mask off Shift and Control so they don't affect the disposition below. |
| 169 modifier_state_uint &= ~(GDK_SHIFT_MASK | GDK_CONTROL_MASK); | 169 modifier_state_uint &= ~(GDK_SHIFT_MASK | GDK_CONTROL_MASK); |
| 170 } else { | 170 } else { |
| 171 command = IDC_RELOAD; | 171 command = IDC_RELOAD; |
| 172 } | 172 } |
| 173 | 173 |
| 174 WindowOpenDisposition disposition = | 174 WindowOpenDisposition disposition = |
| 175 event_utils::DispositionFromEventFlags(modifier_state_uint); | 175 event_utils::DispositionFromGdkState(modifier_state_uint); |
| 176 if ((disposition == CURRENT_TAB) && location_bar_) { | 176 if ((disposition == CURRENT_TAB) && location_bar_) { |
| 177 // Forcibly reset the location bar, since otherwise it won't discard any | 177 // Forcibly reset the location bar, since otherwise it won't discard any |
| 178 // ongoing user edits, since it doesn't realize this is a user-initiated | 178 // ongoing user edits, since it doesn't realize this is a user-initiated |
| 179 // action. | 179 // action. |
| 180 location_bar_->Revert(); | 180 location_bar_->Revert(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 // Start a timer - while this timer is running, the reload button cannot be | 183 // Start a timer - while this timer is running, the reload button cannot be |
| 184 // changed to a stop button. We do not set |intended_mode_| to MODE_STOP | 184 // changed to a stop button. We do not set |intended_mode_| to MODE_STOP |
| 185 // here as the browser will do that when it actually starts loading (which | 185 // here as the browser will do that when it actually starts loading (which |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 gtk_chrome_button_set_use_gtk_rendering(GTK_CHROME_BUTTON(widget()), use_gtk); | 271 gtk_chrome_button_set_use_gtk_rendering(GTK_CHROME_BUTTON(widget()), use_gtk); |
| 272 } | 272 } |
| 273 | 273 |
| 274 void ReloadButtonGtk::OnDoubleClickTimer() { | 274 void ReloadButtonGtk::OnDoubleClickTimer() { |
| 275 ChangeMode(intended_mode_, false); | 275 ChangeMode(intended_mode_, false); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void ReloadButtonGtk::OnStopToReloadTimer() { | 278 void ReloadButtonGtk::OnStopToReloadTimer() { |
| 279 ChangeMode(intended_mode_, true); | 279 ChangeMode(intended_mode_, true); |
| 280 } | 280 } |
| OLD | NEW |