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

Unified Diff: remoting/host/it2me/it2me_confirmation_dialog_win.cc

Issue 2343443002: Adding a confirmation dialog for It2Me on Linux (Closed)
Patch Set: Addressing CR Feedback Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/it2me/it2me_confirmation_dialog_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/it2me/it2me_confirmation_dialog_win.cc
diff --git a/remoting/host/it2me/it2me_confirmation_dialog_win.cc b/remoting/host/it2me/it2me_confirmation_dialog_win.cc
index 4e8453f91e571f866c2b1e68fb7e8ced9ad3c9bf..8075fa34f20bc564bba1aa16bf79a588867656af 100644
--- a/remoting/host/it2me/it2me_confirmation_dialog_win.cc
+++ b/remoting/host/it2me/it2me_confirmation_dialog_win.cc
@@ -5,6 +5,7 @@
#include <windows.h>
#include <commctrl.h>
+#include <cstdint>
#include <memory>
#include <string>
@@ -17,6 +18,7 @@
#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/time/time.h"
#include "remoting/host/it2me/it2me_confirmation_dialog.h"
#include "remoting/host/win/core_resource.h"
@@ -25,7 +27,7 @@ namespace remoting {
namespace {
// Time to wait before closing the dialog and cancelling the connection.
-const int kDialogTimeoutMs = 60 * 1000;
+constexpr base::TimeDelta kDialogTimeout = base::TimeDelta::FromMinutes(1);
const HRESULT kTimeoutErrorCode = E_ABORT;
@@ -179,7 +181,7 @@ It2MeConfirmationDialogWin::TaskDialogCallbackProc(HWND hwnd,
LPARAM l_param,
LONG_PTR ref_data) {
if (notification == TDN_TIMER) {
- if (w_param >= kDialogTimeoutMs) {
+ if (static_cast<int64_t>(w_param) >= kDialogTimeout.InMilliseconds()) {
// Close the dialog window if we have reached the timeout.
return kTimeoutErrorCode;
}
« no previous file with comments | « remoting/host/it2me/it2me_confirmation_dialog_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698