Home | History | Annotate | Download | only in host
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef REMOTING_HOST_VERIFY_CONFIG_WINDOW_WIN_H_
      6 #define REMOTING_HOST_VERIFY_CONFIG_WINDOW_WIN_H_
      7 
      8 // altbase.h must be included before atlapp.h
      9 #include <atlbase.h>
     10 #include <atlapp.h>
     11 #include <atlcrack.h>
     12 #include <atlwin.h>
     13 #include <atluser.h>
     14 #include <string>
     15 
     16 #include "base/callback.h"
     17 #include "remoting/host/win/core_resource.h"
     18 
     19 namespace remoting {
     20 
     21 class VerifyConfigWindowWin : public ATL::CDialogImpl<VerifyConfigWindowWin> {
     22  public:
     23   enum { IDD = IDD_VERIFY_CONFIG_DIALOG };
     24 
     25   BEGIN_MSG_MAP_EX(VerifyConfigWindowWin)
     26     MSG_WM_INITDIALOG(OnInitDialog)
     27     MSG_WM_CLOSE(OnClose)
     28     COMMAND_ID_HANDLER_EX(IDOK, OnOk)
     29     COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel)
     30   END_MSG_MAP()
     31 
     32   VerifyConfigWindowWin(const std::string& email,
     33                         const std::string& host_id,
     34                         const std::string& host_secret_hash);
     35 
     36   void OnCancel(UINT code, int id, HWND control);
     37   void OnClose();
     38   LRESULT OnInitDialog(HWND wparam, LPARAM lparam);
     39   void OnOk(UINT code, int id, HWND control);
     40 
     41  private:
     42   // Centers the dialog window against the owner window.
     43   void CenterWindow();
     44   bool VerifyHostSecretHash();
     45 
     46   CIcon icon_;
     47 
     48   const std::string email_;
     49   const std::string host_id_;
     50   const std::string host_secret_hash_;
     51 
     52   DISALLOW_COPY_AND_ASSIGN(VerifyConfigWindowWin);
     53 };
     54 
     55 }  // namespace remoting
     56 
     57 #endif  // REMOTING_HOST_VERIFY_CONFIG_WINDOW_WIN_H_
     58