OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 if (!ReloadMenuEnabled() || visible_mode_ == MODE_STOP) | 304 if (!ReloadMenuEnabled() || visible_mode_ == MODE_STOP) |
305 return FALSE; | 305 return FALSE; |
306 | 306 |
307 if (event->button == 3) | 307 if (event->button == 3) |
308 ShowReloadMenu(event->button, event->time); | 308 ShowReloadMenu(event->button, event->time); |
309 | 309 |
310 if (event->button != 1) | 310 if (event->button != 1) |
311 return FALSE; | 311 return FALSE; |
312 | 312 |
313 y_position_of_last_press_ = static_cast<int>(event->y); | 313 y_position_of_last_press_ = static_cast<int>(event->y); |
314 MessageLoop::current()->PostDelayedTask( | 314 base::MessageLoop::current()->PostDelayedTask( |
315 FROM_HERE, | 315 FROM_HERE, |
316 base::Bind(&ReloadButtonGtk::ShowReloadMenu, | 316 base::Bind(&ReloadButtonGtk::ShowReloadMenu, |
317 weak_factory_.GetWeakPtr(), | 317 weak_factory_.GetWeakPtr(), |
318 event->button, | 318 event->button, |
319 event->time), | 319 event->time), |
320 base::TimeDelta::FromMilliseconds(kReloadMenuTimerDelay)); | 320 base::TimeDelta::FromMilliseconds(kReloadMenuTimerDelay)); |
321 return FALSE; | 321 return FALSE; |
322 } | 322 } |
323 | 323 |
324 gboolean ReloadButtonGtk::OnMouseMove(GtkWidget* widget, | 324 gboolean ReloadButtonGtk::OnMouseMove(GtkWidget* widget, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 bool ReloadButtonGtk::ReloadMenuEnabled() { | 453 bool ReloadButtonGtk::ReloadMenuEnabled() { |
454 if (!browser_) | 454 if (!browser_) |
455 return false; | 455 return false; |
456 return chrome::IsDebuggerAttachedToCurrentTab(browser_); | 456 return chrome::IsDebuggerAttachedToCurrentTab(browser_); |
457 } | 457 } |
458 | 458 |
459 void ReloadButtonGtk::ClearCache() { | 459 void ReloadButtonGtk::ClearCache() { |
460 if (browser_) | 460 if (browser_) |
461 chrome::ClearCache(browser_); | 461 chrome::ClearCache(browser_); |
462 } | 462 } |
OLD | NEW |