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

Unified Diff: chrome/browser/ui/panels/panel_browser_view.cc

Issue 8775023: Remove static initialization from the panels code. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: . Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_browser_window_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_browser_view.cc
diff --git a/chrome/browser/ui/panels/panel_browser_view.cc b/chrome/browser/ui/panels/panel_browser_view.cc
index 0a887e2e5106c468c3f6da82f4a9c8dd84b48ee0..6ab12d83f757111134de215a7883c1c7fd54abd9 100644
--- a/chrome/browser/ui/panels/panel_browser_view.cc
+++ b/chrome/browser/ui/panels/panel_browser_view.cc
@@ -25,13 +25,11 @@ namespace {
const int kSetBoundsAnimationMs = 180;
// The threshold to differentiate the short click and long click.
-const base::TimeDelta kShortClickThresholdMs =
- base::TimeDelta::FromMilliseconds(200);
+const int kShortClickThresholdMs = 200;
// Delay before click-to-minimize is allowed after the attention has been
// cleared.
-const base::TimeDelta kSuspendMinimizeOnClickIntervalMs =
- base::TimeDelta::FromMilliseconds(500);
+const int kSuspendMinimizeOnClickIntervalMs = 500;
}
@@ -441,13 +439,14 @@ bool PanelBrowserView::OnTitlebarMouseReleased() {
// a hack to prevent the panel from being minimized when the user clicks on
// the title-bar to clear the attention.
if (panel_->expansion_state() == Panel::EXPANDED &&
- base::TimeTicks::Now() < attention_cleared_time_ +
- kSuspendMinimizeOnClickIntervalMs) {
+ base::TimeTicks::Now() - attention_cleared_time_ <
+ base::TimeDelta::FromMilliseconds(kSuspendMinimizeOnClickIntervalMs)) {
return true;
}
// Do not minimize the panel if it is long click.
- if (base::TimeTicks::Now() - mouse_pressed_time_ > kShortClickThresholdMs)
+ if (base::TimeTicks::Now() - mouse_pressed_time_ >
+ base::TimeDelta::FromMilliseconds(kShortClickThresholdMs))
return true;
Panel::ExpansionState new_expansion_state =
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_browser_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698