summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-13 16:53:06 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-13 16:53:06 +0000
commitb509ec89a63c234c5e366ccee7b287150e337b6b (patch)
tree54a1b047a915f5511edf3d81fa13725a9b6f121b /chrome_frame
parent20575147477c207d5c36dc0a300daacfebdbdb38 (diff)
downloadchromium_src-b509ec89a63c234c5e366ccee7b287150e337b6b.zip
chromium_src-b509ec89a63c234c5e366ccee7b287150e337b6b.tar.gz
chromium_src-b509ec89a63c234c5e366ccee7b287150e337b6b.tar.bz2
Return an error for command groups we don't support.
TEST=Should be no feature change but if anything this could clear up false positives where we report the status of a menu item as being enabled instead of not available. BUG=none Review URL: http://codereview.chromium.org/1589029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_active_document.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index 40be889..26bfa4f 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -293,6 +293,23 @@ STDMETHODIMP ChromeActiveDocument::QueryStatus(const GUID* cmd_group_guid,
OLECMD commands[],
OLECMDTEXT* command_text) {
DLOG(INFO) << __FUNCTION__;
+ const GUID* supported_groups[] = {
+ &GUID_NULL,
+ &CGID_MSHTML,
+ &CGID_Explorer,
+ };
+
+ bool supported = (cmd_group_guid == NULL);
+ for (int i = 0; !supported && i < arraysize(supported_groups); ++i) {
+ supported = (IsEqualGUID(*cmd_group_guid, *supported_groups[i]) != FALSE);
+ }
+
+ if (!supported) {
+ DLOG(INFO) << "unsupported command group: "
+ << GuidToString(*cmd_group_guid);
+ return OLECMDERR_E_NOTSUPPORTED;
+ }
+
for (ULONG command_index = 0; command_index < number_of_commands;
command_index++) {
DLOG(INFO) << "Command id = " << commands[command_index].cmdID;
@@ -954,7 +971,7 @@ bool ChromeActiveDocument::ParseUrl(const std::wstring& url,
bool ChromeActiveDocument::LaunchUrl(const std::wstring& url,
bool is_new_navigation) {
- url_.Reset(::SysAllocString(url.c_str()));
+ url_.Allocate(url.c_str());
if (!is_new_navigation) {
WStringTokenizer tokenizer(url, L"&");