| OLD | NEW |
| 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <mshtmhst.h> | 6 #include <mshtmhst.h> |
| 7 #include <urlmon.h> | 7 #include <urlmon.h> |
| 8 | 8 |
| 9 #include "base/win/scoped_variant.h" | 9 #include "base/win/scoped_variant.h" |
| 10 #include "chrome/installer/util/html_dialog.h" | 10 #include "chrome/installer/util/html_dialog.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // the values of DialogResult and call window.close(). | 39 // the values of DialogResult and call window.close(). |
| 40 | 40 |
| 41 class HTMLDialogWin : public HTMLDialog { | 41 class HTMLDialogWin : public HTMLDialog { |
| 42 public: | 42 public: |
| 43 HTMLDialogWin(const std::wstring& url, const std::wstring& param) | 43 HTMLDialogWin(const std::wstring& url, const std::wstring& param) |
| 44 : url_(url), param_(param) { | 44 : url_(url), param_(param) { |
| 45 if (!mshtml_) | 45 if (!mshtml_) |
| 46 mshtml_ = LoadLibrary(L"MSHTML.DLL"); | 46 mshtml_ = LoadLibrary(L"MSHTML.DLL"); |
| 47 } | 47 } |
| 48 | 48 |
| 49 virtual DialogResult ShowModal(void* parent_window, | 49 DialogResult ShowModal(void* parent_window, |
| 50 CustomizationCallback* callback) { | 50 CustomizationCallback* callback) override { |
| 51 int result = HTML_DLG_DECLINE; | 51 int result = HTML_DLG_DECLINE; |
| 52 if (!InternalDoDialog(callback, &result)) | 52 if (!InternalDoDialog(callback, &result)) |
| 53 return HTML_DLG_ERROR; | 53 return HTML_DLG_ERROR; |
| 54 return static_cast<DialogResult>(result); | 54 return static_cast<DialogResult>(result); |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual std::wstring GetExtraResult() { | 57 std::wstring GetExtraResult() override { return extra_result_; } |
| 58 return extra_result_; | |
| 59 } | |
| 60 | 58 |
| 61 private: | 59 private: |
| 62 bool InternalDoDialog(CustomizationCallback* callback, int* result); | 60 bool InternalDoDialog(CustomizationCallback* callback, int* result); |
| 63 static LRESULT CALLBACK MsgFilter(int code, WPARAM wParam, LPARAM lParam); | 61 static LRESULT CALLBACK MsgFilter(int code, WPARAM wParam, LPARAM lParam); |
| 64 | 62 |
| 65 std::wstring url_; | 63 std::wstring url_; |
| 66 std::wstring param_; | 64 std::wstring param_; |
| 67 static HHOOK hook_; | 65 static HHOOK hook_; |
| 68 static HINSTANCE mshtml_; | 66 static HINSTANCE mshtml_; |
| 69 static CustomizationCallback* callback_; | 67 static CustomizationCallback* callback_; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 HTMLDialog::DialogResult dr = dialog_->ShowModal(NULL, &customizer); | 185 HTMLDialog::DialogResult dr = dialog_->ShowModal(NULL, &customizer); |
| 188 if (HTMLDialog::HTML_DLG_ACCEPT == dr) | 186 if (HTMLDialog::HTML_DLG_ACCEPT == dr) |
| 189 return EulaHTMLDialog::ACCEPTED; | 187 return EulaHTMLDialog::ACCEPTED; |
| 190 else if (HTMLDialog::HTML_DLG_EXTRA == dr) | 188 else if (HTMLDialog::HTML_DLG_EXTRA == dr) |
| 191 return EulaHTMLDialog::ACCEPTED_OPT_IN; | 189 return EulaHTMLDialog::ACCEPTED_OPT_IN; |
| 192 else | 190 else |
| 193 return EulaHTMLDialog::REJECTED; | 191 return EulaHTMLDialog::REJECTED; |
| 194 } | 192 } |
| 195 | 193 |
| 196 } // namespace installer | 194 } // namespace installer |
| OLD | NEW |