OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Implements our scripting host. | 5 // Implements our scripting host. |
6 | 6 |
7 #include "ceee/ie/plugin/scripting/script_host.h" | 7 #include "ceee/ie/plugin/scripting/script_host.h" |
8 | 8 |
9 #include <dispex.h> | 9 #include <dispex.h> |
10 #include <mshtml.h> | 10 #include <mshtml.h> |
11 #include <mshtmhst.h> | 11 #include <mshtmhst.h> |
12 #include <objsafe.h> | 12 #include <objsafe.h> |
13 | 13 |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "base/stringize_macros.h" |
16 #include "ceee/common/com_utils.h" | 17 #include "ceee/common/com_utils.h" |
17 | 18 |
| 19 #include "version.h" // NOLINT |
| 20 |
18 #ifndef CMDID_SCRIPTSITE_URL | 21 #ifndef CMDID_SCRIPTSITE_URL |
19 | 22 |
20 // These are documented in MSDN, but not declared in the platform SDK. | 23 // These are documented in MSDN, but not declared in the platform SDK. |
21 // See [http://msdn.microsoft.com/en-us/library/aa769871(VS.85).aspx]. | 24 // See [http://msdn.microsoft.com/en-us/library/aa769871(VS.85).aspx]. |
22 #define CMDID_SCRIPTSITE_URL 0 | 25 #define CMDID_SCRIPTSITE_URL 0 |
23 #define CMDID_SCRIPTSITE_HTMLDLGTRUST 1 | 26 #define CMDID_SCRIPTSITE_HTMLDLGTRUST 1 |
24 #define CMDID_SCRIPTSITE_SECSTATE 2 | 27 #define CMDID_SCRIPTSITE_SECSTATE 2 |
25 #define CMDID_SCRIPTSITE_SID 3 | 28 #define CMDID_SCRIPTSITE_SID 3 |
26 #define CMDID_SCRIPTSITE_TRUSTEDDOC 4 | 29 #define CMDID_SCRIPTSITE_TRUSTEDDOC 4 |
27 #define CMDID_SCRIPTSITE_SECURITY_WINDOW 5 | 30 #define CMDID_SCRIPTSITE_SECURITY_WINDOW 5 |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 BOOL* enter_debugger, BOOL* call_on_script_err_when_continuing) { | 519 BOOL* enter_debugger, BOOL* call_on_script_err_when_continuing) { |
517 DCHECK(err); | 520 DCHECK(err); |
518 DCHECK(enter_debugger); | 521 DCHECK(enter_debugger); |
519 DCHECK(call_on_script_err_when_continuing); | 522 DCHECK(call_on_script_err_when_continuing); |
520 if (!err || !enter_debugger || !call_on_script_err_when_continuing) | 523 if (!err || !enter_debugger || !call_on_script_err_when_continuing) |
521 return E_POINTER; | 524 return E_POINTER; |
522 | 525 |
523 // TODO(ericdingle@chromium.org): internationalization | 526 // TODO(ericdingle@chromium.org): internationalization |
524 int ret = ::MessageBox( | 527 int ret = ::MessageBox( |
525 NULL, L"A script error occured. Do you want to debug?", | 528 NULL, L"A script error occured. Do you want to debug?", |
526 L"Google Chrome Extensions Execution Environment", | 529 TO_L_STRING(CEEE_PRODUCT_FULLNAME_STRING), |
527 MB_ICONERROR | MB_SETFOREGROUND | MB_TASKMODAL | MB_YESNO); | 530 MB_ICONERROR | MB_SETFOREGROUND | MB_TASKMODAL | MB_YESNO); |
528 *enter_debugger = (ret == IDYES); | 531 *enter_debugger = (ret == IDYES); |
529 *call_on_script_err_when_continuing = FALSE; | 532 *call_on_script_err_when_continuing = FALSE; |
530 | 533 |
531 return S_OK; | 534 return S_OK; |
532 } | 535 } |
533 | 536 |
534 STDMETHODIMP ScriptHost::QueryStatus(const GUID* cmd_group, ULONG num_cmds, | 537 STDMETHODIMP ScriptHost::QueryStatus(const GUID* cmd_group, ULONG num_cmds, |
535 OLECMD cmds[], OLECMDTEXT *cmd_text) { | 538 OLECMD cmds[], OLECMDTEXT *cmd_text) { |
536 LOG(WARNING) << "QueryStatus " << | 539 LOG(WARNING) << "QueryStatus " << |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 } | 880 } |
878 | 881 |
879 HRESULT ScriptHost::DebugApplication::CreateProcessDebugManager( | 882 HRESULT ScriptHost::DebugApplication::CreateProcessDebugManager( |
880 IProcessDebugManager** manager) { | 883 IProcessDebugManager** manager) { |
881 return ::CoCreateInstance(CLSID_ProcessDebugManager, | 884 return ::CoCreateInstance(CLSID_ProcessDebugManager, |
882 NULL, | 885 NULL, |
883 CLSCTX_INPROC_SERVER, | 886 CLSCTX_INPROC_SERVER, |
884 IID_IProcessDebugManager, | 887 IID_IProcessDebugManager, |
885 reinterpret_cast<void**>(manager)); | 888 reinterpret_cast<void**>(manager)); |
886 } | 889 } |
OLD | NEW |