Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: chrome/browser/ui/gtk/reload_button_gtk.cc

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/protocol_dialog_gtk.cc ('k') | chrome/browser/ui/gtk/reload_button_gtk_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698