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

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

Issue 7812036: Update base/timer.h code to pass through Location from call sites. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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) 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/browser_window_gtk.h" 5 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include <dlfcn.h> 9 #include <dlfcn.h>
10 #include <string> 10 #include <string>
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 UpdateDevToolsForContents( 789 UpdateDevToolsForContents(
790 browser_->GetSelectedTabContents()); 790 browser_->GetSelectedTabContents());
791 } 791 }
792 792
793 void BrowserWindowGtk::UpdateLoadingAnimations(bool should_animate) { 793 void BrowserWindowGtk::UpdateLoadingAnimations(bool should_animate) {
794 if (should_animate) { 794 if (should_animate) {
795 if (!loading_animation_timer_.IsRunning()) { 795 if (!loading_animation_timer_.IsRunning()) {
796 // Loads are happening, and the timer isn't running, so start it. 796 // Loads are happening, and the timer isn't running, so start it.
797 loading_animation_timer_.Start( 797 loading_animation_timer_.Start(
798 base::TimeDelta::FromMilliseconds(kLoadingAnimationFrameTimeMs), this, 798 base::TimeDelta::FromMilliseconds(kLoadingAnimationFrameTimeMs), this,
799 &BrowserWindowGtk::LoadingAnimationCallback); 799 &BrowserWindowGtk::LoadingAnimationCallback, FROM_HERE);
800 } 800 }
801 } else { 801 } else {
802 if (loading_animation_timer_.IsRunning()) { 802 if (loading_animation_timer_.IsRunning()) {
803 loading_animation_timer_.Stop(); 803 loading_animation_timer_.Stop();
804 // Loads are now complete, update the state if a task was scheduled. 804 // Loads are now complete, update the state if a task was scheduled.
805 LoadingAnimationCallback(); 805 LoadingAnimationCallback();
806 } 806 }
807 } 807 }
808 } 808 }
809 809
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 // restore, if enabled, will restore windows to incorrect positions.) That's 1416 // restore, if enabled, will restore windows to incorrect positions.) That's
1417 // a round trip to the X server though, so we set a debounce timer and only 1417 // a round trip to the X server though, so we set a debounce timer and only
1418 // call it (in OnDebouncedBoundsChanged() below) after we haven't seen a 1418 // call it (in OnDebouncedBoundsChanged() below) after we haven't seen a
1419 // reconfigure event in a short while. 1419 // reconfigure event in a short while.
1420 // We don't use Reset() because the timer may not yet be running. 1420 // We don't use Reset() because the timer may not yet be running.
1421 // (In that case Stop() is a no-op.) 1421 // (In that case Stop() is a no-op.)
1422 if (!debounce_timer_disabled_) { 1422 if (!debounce_timer_disabled_) {
1423 window_configure_debounce_timer_.Stop(); 1423 window_configure_debounce_timer_.Stop();
1424 window_configure_debounce_timer_.Start(base::TimeDelta::FromMilliseconds( 1424 window_configure_debounce_timer_.Start(base::TimeDelta::FromMilliseconds(
1425 kDebounceTimeoutMilliseconds), this, 1425 kDebounceTimeoutMilliseconds), this,
1426 &BrowserWindowGtk::OnDebouncedBoundsChanged); 1426 &BrowserWindowGtk::OnDebouncedBoundsChanged, FROM_HERE);
1427 } 1427 }
1428 1428
1429 return FALSE; 1429 return FALSE;
1430 } 1430 }
1431 1431
1432 void BrowserWindowGtk::OnDebouncedBoundsChanged() { 1432 void BrowserWindowGtk::OnDebouncedBoundsChanged() {
1433 gint x, y; 1433 gint x, y;
1434 gtk_window_get_position(window_, &x, &y); 1434 gtk_window_get_position(window_, &x, &y);
1435 gfx::Point origin(x, y); 1435 gfx::Point origin(x, y);
1436 bounds_.set_origin(origin); 1436 bounds_.set_origin(origin);
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
2388 // are taken from the WMs' source code. 2388 // are taken from the WMs' source code.
2389 return (wm_name == "Blackbox" || 2389 return (wm_name == "Blackbox" ||
2390 wm_name == "compiz" || 2390 wm_name == "compiz" ||
2391 wm_name == "Compiz" || 2391 wm_name == "Compiz" ||
2392 wm_name == "e16" || // Enlightenment DR16 2392 wm_name == "e16" || // Enlightenment DR16
2393 wm_name == "Metacity" || 2393 wm_name == "Metacity" ||
2394 wm_name == "Mutter" || 2394 wm_name == "Mutter" ||
2395 wm_name == "Openbox" || 2395 wm_name == "Openbox" ||
2396 wm_name == "Xfwm4"); 2396 wm_name == "Xfwm4");
2397 } 2397 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698