From 074283adf1264cebfd1272afae558d2d7366a988 Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Fri, 28 May 2010 23:47:59 +0000 Subject: Simplify Chrome Frame usage of Chrome identifiers by simply using the Chrome identifiers directly. This required renaming a few identifiers to avoid macro renaming conflicts when including the Chrome headers. BUG=none TEST=none Review URL: http://codereview.chromium.org/2359002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48543 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome_frame/chrome_active_document.cc | 11 +++++------ chrome_frame/chrome_active_document.h | 6 +++--- chrome_frame/chrome_frame.gyp | 2 -- chrome_frame/chrome_frame_activex.h | 4 ++-- chrome_frame/chrome_imported_resources.cc | 13 ------------- chrome_frame/chrome_imported_resources.h | 10 ---------- chrome_frame/resources/chrome_frame_resources.grd | 4 ++-- chrome_frame/resources/structured_resources.rc | 10 +++++----- 8 files changed, 17 insertions(+), 43 deletions(-) delete mode 100644 chrome_frame/chrome_imported_resources.cc delete mode 100644 chrome_frame/chrome_imported_resources.h (limited to 'chrome_frame') diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index 894564a..d850240 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -30,6 +30,7 @@ #include "base/trace_event.h" #include "grit/generated_resources.h" +#include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/navigation_types.h" @@ -37,7 +38,6 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome_frame/bho.h" #include "chrome_frame/bind_context_info.h" -#include "chrome_frame/chrome_imported_resources.h" #include "chrome_frame/utils.h" const wchar_t kChromeAttachExternalTabPrefix[] = L"attach_external_tab"; @@ -873,15 +873,14 @@ bool ChromeActiveDocument::HandleContextMenuCommand(UINT cmd, ScopedComPtr web_browser2; DoQueryService(SID_SWebBrowserApp, m_spClientSite, web_browser2.Receive()); - if (cmd == static_cast(context_menu_IDC_BACK)) { + if (cmd == IDC_BACK) web_browser2->GoBack(); - } else if (cmd == static_cast(context_menu_IDC_FORWARD)) { + else if (cmd == IDC_FORWARD) web_browser2->GoForward(); - } else if (cmd == static_cast(context_menu_IDC_RELOAD)) { + else if (cmd == IDC_RELOAD) web_browser2->Refresh(); - } else { + else return BaseActiveX::HandleContextMenuCommand(cmd, params); - } return true; } diff --git a/chrome_frame/chrome_active_document.h b/chrome_frame/chrome_active_document.h index 575c06a..bd1474f 100644 --- a/chrome_frame/chrome_active_document.h +++ b/chrome_frame/chrome_active_document.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -232,8 +232,8 @@ END_COM_MAP() BEGIN_MSG_MAP(ChromeActiveDocument) MESSAGE_HANDLER(WM_FIRE_PRIVACY_CHANGE_NOTIFICATION, OnFirePrivacyChange) - COMMAND_ID_HANDLER(IDC_FORWARD, OnForward) - COMMAND_ID_HANDLER(IDC_BACK, OnBack) + COMMAND_ID_HANDLER(IDC_CHROMEFRAME_FORWARD, OnForward) + COMMAND_ID_HANDLER(IDC_CHROMEFRAME_BACK, OnBack) CHAIN_MSG_MAP(BaseActiveX) END_MSG_MAP() diff --git a/chrome_frame/chrome_frame.gyp b/chrome_frame/chrome_frame.gyp index 141a88e..a457583 100644 --- a/chrome_frame/chrome_frame.gyp +++ b/chrome_frame/chrome_frame.gyp @@ -608,8 +608,6 @@ 'chrome_frame_histograms.h', 'chrome_frame_reporting.cc', 'chrome_frame_reporting.h', - 'chrome_imported_resources.cc', - 'chrome_imported_resources.h', 'chrome_launcher_utils.cc', 'chrome_launcher_utils.h', 'chrome_protocol.cc', diff --git a/chrome_frame/chrome_frame_activex.h b/chrome_frame/chrome_frame_activex.h index ffe7880..e55e25e 100644 --- a/chrome_frame/chrome_frame_activex.h +++ b/chrome_frame/chrome_frame_activex.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -41,7 +41,7 @@ class ATL_NO_VTABLE ChromeFrameActivex ChromeFrameActivex(); ~ChromeFrameActivex(); -DECLARE_REGISTRY_RESOURCEID(IDR_CHROMEFRAME) +DECLARE_REGISTRY_RESOURCEID(IDR_CHROMEFRAME_ACTIVEX) BEGIN_COM_MAP(ChromeFrameActivex) COM_INTERFACE_ENTRY(IObjectWithSite) diff --git a/chrome_frame/chrome_imported_resources.cc b/chrome_frame/chrome_imported_resources.cc deleted file mode 100644 index 966fadf..0000000 --- a/chrome_frame/chrome_imported_resources.cc +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// Defines resource ids included from Chrome. This is done to prevent resource -// id conflicts. -#pragma once - -#include "chrome/app/chrome_dll_resource.h" - -int context_menu_IDC_FORWARD = IDC_FORWARD; -int context_menu_IDC_RELOAD = IDC_RELOAD; -int context_menu_IDC_BACK = IDC_BACK; - diff --git a/chrome_frame/chrome_imported_resources.h b/chrome_frame/chrome_imported_resources.h deleted file mode 100644 index 6b950ea..0000000 --- a/chrome_frame/chrome_imported_resources.h +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// Defines resource ids included from Chrome. This is done to prevent resource -// id conflicts. - -extern int context_menu_IDC_FORWARD; -extern int context_menu_IDC_RELOAD; -extern int context_menu_IDC_BACK; - diff --git a/chrome_frame/resources/chrome_frame_resources.grd b/chrome_frame/resources/chrome_frame_resources.grd index a8107fd..f9d9a7f 100644 --- a/chrome_frame/resources/chrome_frame_resources.grd +++ b/chrome_frame/resources/chrome_frame_resources.grd @@ -1,7 +1,7 @@ @@ -30,7 +30,7 @@ for localizable strings - + diff --git a/chrome_frame/resources/structured_resources.rc b/chrome_frame/resources/structured_resources.rc index 1d07e05..28bcf9b 100644 --- a/chrome_frame/resources/structured_resources.rc +++ b/chrome_frame/resources/structured_resources.rc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,8 +9,8 @@ IDR_CHROME_FRAME_IE_FULL_TAB ACCELERATORS BEGIN - VK_LEFT, IDC_BACK, VIRTKEY, ALT - VK_BACK, IDC_BACK, VIRTKEY - VK_BACK, IDC_FORWARD, VIRTKEY, SHIFT - VK_RIGHT, IDC_FORWARD, VIRTKEY, ALT + VK_LEFT, IDC_CHROMEFRAME_BACK, VIRTKEY, ALT + VK_BACK, IDC_CHROMEFRAME_BACK, VIRTKEY + VK_BACK, IDC_CHROMEFRAME_FORWARD, VIRTKEY, SHIFT + VK_RIGHT, IDC_CHROMEFRAME_FORWARD, VIRTKEY, ALT END -- cgit v1.1