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

Side by Side Diff: ui/views/widget/tooltip_manager_win.cc

Issue 10026013: Update use of TimeDelta in chrome/browser/*, ui/views/*, and other places. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase onto master. Created 8 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
« no previous file with comments | « ui/views/widget/aero_tooltip_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/widget/tooltip_manager_win.h" 5 #include "ui/views/widget/tooltip_manager_win.h"
6 6
7 #include <windowsx.h> 7 #include <windowsx.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 views::GetMonitorBoundsForRect(gfx::Rect(rect_bounds)); 365 views::GetMonitorBoundsForRect(gfx::Rect(rect_bounds));
366 rect_bounds = gfx::Rect(rect_bounds).AdjustToFit(monitor_bounds).ToRECT(); 366 rect_bounds = gfx::Rect(rect_bounds).AdjustToFit(monitor_bounds).ToRECT();
367 ::SetWindowPos(keyboard_tooltip_hwnd_, NULL, rect_bounds.left, 367 ::SetWindowPos(keyboard_tooltip_hwnd_, NULL, rect_bounds.left,
368 rect_bounds.top, 0, 0, 368 rect_bounds.top, 0, 0,
369 SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE); 369 SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE);
370 MessageLoop::current()->PostDelayedTask( 370 MessageLoop::current()->PostDelayedTask(
371 FROM_HERE, 371 FROM_HERE,
372 base::Bind(&TooltipManagerWin::DestroyKeyboardTooltipWindow, 372 base::Bind(&TooltipManagerWin::DestroyKeyboardTooltipWindow,
373 keyboard_tooltip_factory_.GetWeakPtr(), 373 keyboard_tooltip_factory_.GetWeakPtr(),
374 keyboard_tooltip_hwnd_), 374 keyboard_tooltip_hwnd_),
375 kDefaultTimeout); 375 base::TimeDelta::FromMilliseconds(kDefaultTimeout));
376 } 376 }
377 377
378 void TooltipManagerWin::HideKeyboardTooltip() { 378 void TooltipManagerWin::HideKeyboardTooltip() {
379 if (keyboard_tooltip_hwnd_ != NULL) { 379 if (keyboard_tooltip_hwnd_ != NULL) {
380 SendMessage(keyboard_tooltip_hwnd_, WM_CLOSE, 0, 0); 380 SendMessage(keyboard_tooltip_hwnd_, WM_CLOSE, 0, 0);
381 keyboard_tooltip_hwnd_ = NULL; 381 keyboard_tooltip_hwnd_ = NULL;
382 } 382 }
383 } 383 }
384 384
385 void TooltipManagerWin::DestroyKeyboardTooltipWindow(HWND window_to_destroy) { 385 void TooltipManagerWin::DestroyKeyboardTooltipWindow(HWND window_to_destroy) {
386 if (keyboard_tooltip_hwnd_ == window_to_destroy) 386 if (keyboard_tooltip_hwnd_ == window_to_destroy)
387 HideKeyboardTooltip(); 387 HideKeyboardTooltip();
388 } 388 }
389 389
390 } // namespace views 390 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/aero_tooltip_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698