diff options
-rw-r--r-- | chrome/app/cf_resources.rc | 37 | ||||
-rw-r--r-- | chrome/app/generated_resources.grd | 6 | ||||
-rw-r--r-- | chrome/chrome.gyp | 3 | ||||
-rw-r--r-- | chrome_frame/chrome_active_document.cc | 3 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_activex_base.h | 10 | ||||
-rw-r--r-- | chrome_frame/find_dialog.h | 4 | ||||
-rw-r--r-- | chrome_frame/resources/chrome_frame_resources.grd | 5 | ||||
-rw-r--r-- | chrome_frame/resources/structured_resources.rc | 28 | ||||
-rw-r--r-- | chrome_frame/simple_resource_loader.cc | 4 | ||||
-rw-r--r-- | chrome_frame/simple_resource_loader.h | 4 |
10 files changed, 74 insertions, 30 deletions
diff --git a/chrome/app/cf_resources.rc b/chrome/app/cf_resources.rc new file mode 100644 index 0000000..865ba9e --- /dev/null +++ b/chrome/app/cf_resources.rc @@ -0,0 +1,37 @@ +// 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. + + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#include "grit\\generated_resources.h" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_CHROME_FRAME_FIND_DIALOG DIALOGEX 0, 0, 278, 60 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "Find" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + EDITTEXT IDC_FIND_TEXT,51,7,154,14,ES_AUTOHSCROLL + DEFPUSHBUTTON "&Find Next",IDOK,221,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,221,24,50,14 + CONTROL "Match &case",IDC_MATCH_CASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,24,52,10 + GROUPBOX "Direction",IDC_STATIC,85,24,119,24 + CONTROL "&Down",IDC_DIRECTION_DOWN,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,101,34,34,10 + CONTROL "&Up",IDC_DIRECTION_UP,"Button",BS_AUTORADIOBUTTON,155,34,38,10 + LTEXT "Fi&nd what:",IDC_STATIC,6,7,35,8 +END diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 7406d69..bd4bd29 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -7228,5 +7228,11 @@ Keep your key file in a safe place. You will need it to create new versions of y Import bookmarks now... </message> </messages> + + <structures first_id="50000" fallback_to_english="true"> + <structure name="IDD_CHROME_FRAME_FIND_DIALOG" file="cf_resources.rc" type="dialog" > + </structure> + </structures> + </release> </grit> diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index c604cdf..616a0f4 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -280,6 +280,9 @@ '<@(chrome_strings_grds)', '<@(chrome_strings_inputs)', ], + 'include_dirs': [ + '<(grit_out_dir)', + ], 'direct_dependent_settings': { 'include_dirs': [ '<(grit_out_dir)', diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index 2c9cba6..ee79e1a 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -98,8 +98,9 @@ HRESULT ChromeActiveDocument::FinalConstruct() { enabled_commands_map_[OLECMDID_SELECTALL] = true; enabled_commands_map_[OLECMDID_SAVEAS] = true; + HMODULE this_module = reinterpret_cast<HMODULE>(&__ImageBase); accelerator_table_ = - LoadAccelerators(GetModuleHandle(L"npchrome_frame.dll"), + LoadAccelerators(this_module, MAKEINTRESOURCE(IDR_CHROME_FRAME_IE_FULL_TAB)); DCHECK(accelerator_table_ != NULL); return S_OK; diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index a8191a9..7240dbe 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -39,6 +39,7 @@ #include "chrome_frame/chrome_frame_plugin.h" #include "chrome_frame/com_message_event.h" #include "chrome_frame/com_type_info_holder.h" +#include "chrome_frame/simple_resource_loader.h" #include "chrome_frame/urlmon_url_request.h" #include "chrome/common/url_constants.h" #include "grit/generated_resources.h" @@ -235,7 +236,16 @@ END_MSG_MAP() DECLARE_PROTECT_FINAL_CONSTRUCT() + virtual void SetResourceModule() { + SimpleResourceLoader* loader_instance = SimpleResourceLoader::instance(); + DCHECK(loader_instance); + HINSTANCE res_dll = loader_instance->GetResourceModuleHandle(); + _AtlBaseModule.SetResourceInstance(res_dll); + } + HRESULT FinalConstruct() { + SetResourceModule(); + if (!Initialize()) return E_OUTOFMEMORY; diff --git a/chrome_frame/find_dialog.h b/chrome_frame/find_dialog.h index f2089b9..ac75f81 100644 --- a/chrome_frame/find_dialog.h +++ b/chrome_frame/find_dialog.h @@ -10,13 +10,13 @@ #include "base/ref_counted.h" #include "resource.h" -#include "grit/chrome_frame_resources.h" +#include "grit/generated_resources.h" class ChromeFrameAutomationClient; class CFFindDialog : public CDialogImpl<CFFindDialog> { public: - enum { IDD = IDD_FIND_DIALOG }; + enum { IDD = IDD_CHROME_FRAME_FIND_DIALOG }; BEGIN_MSG_MAP(CFFindDialog) MESSAGE_HANDLER(WM_DESTROY, OnDestroy) diff --git a/chrome_frame/resources/chrome_frame_resources.grd b/chrome_frame/resources/chrome_frame_resources.grd index abd6547..a8107fd 100644 --- a/chrome_frame/resources/chrome_frame_resources.grd +++ b/chrome_frame/resources/chrome_frame_resources.grd @@ -20,11 +20,6 @@ for localizable strings <output filename="chrome_frame_resources.pak" type="data_package" /> </outputs> <release seq="1"> - <!-- TODO(robertshield): All that's left now is to localize the dialog resource. --> - <structures first_id="50000"> - <structure name="IDD_FIND_DIALOG" file="structured_resources.rc" type="dialog" > - </structure> - </structures> <structures first_id="50005"> <structure name="IDR_CHROME_FRAME_IE_FULL_TAB" file="structured_resources.rc" type="accelerators" > </structure> diff --git a/chrome_frame/resources/structured_resources.rc b/chrome_frame/resources/structured_resources.rc index d2dbed3..1d07e05 100644 --- a/chrome_frame/resources/structured_resources.rc +++ b/chrome_frame/resources/structured_resources.rc @@ -4,29 +4,13 @@ ///////////////////////////////////////////////////////////////////////////// // -// Dialog +// Accelerators // -IDD_FIND_DIALOG DIALOGEX 0, 0, 278, 60 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "Find" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 +IDR_CHROME_FRAME_IE_FULL_TAB ACCELERATORS BEGIN - EDITTEXT IDC_FIND_TEXT,51,7,154,14,ES_AUTOHSCROLL - DEFPUSHBUTTON "&Find Next",IDOK,221,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,221,24,50,14 - CONTROL "Match &case",IDC_MATCH_CASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,24,52,10 - GROUPBOX "Direction",IDC_STATIC,85,24,119,24 - CONTROL "&Down",IDC_DIRECTION_DOWN,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,101,34,34,10 - CONTROL "&Up",IDC_DIRECTION_UP,"Button",BS_AUTORADIOBUTTON,155,34,38,10 - LTEXT "Fi&nd what:",IDC_STATIC,6,7,35,8 + VK_LEFT, IDC_BACK, VIRTKEY, ALT + VK_BACK, IDC_BACK, VIRTKEY + VK_BACK, IDC_FORWARD, VIRTKEY, SHIFT + VK_RIGHT, IDC_FORWARD, VIRTKEY, ALT END - -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
-END
diff --git a/chrome_frame/simple_resource_loader.cc b/chrome_frame/simple_resource_loader.cc index 2eb2167..e5f2924 100644 --- a/chrome_frame/simple_resource_loader.cc +++ b/chrome_frame/simple_resource_loader.cc @@ -134,3 +134,7 @@ std::wstring SimpleResourceLoader::Get(int message_id) { SimpleResourceLoader* loader = SimpleResourceLoader::instance(); return loader->GetLocalizedResource(message_id); } + +HINSTANCE SimpleResourceLoader::GetResourceModuleHandle() { + return locale_dll_handle_; +} diff --git a/chrome_frame/simple_resource_loader.h b/chrome_frame/simple_resource_loader.h index 2ec9860..95e4425 100644 --- a/chrome_frame/simple_resource_loader.h +++ b/chrome_frame/simple_resource_loader.h @@ -26,6 +26,10 @@ class SimpleResourceLoader { // from the currently loaded locale dll. static std::wstring Get(int message_id); + // Retrieves the HINSTANCE of the loaded module handle. May be NULL if a + // resource DLL could not be loaded. + HINSTANCE GetResourceModuleHandle(); + private: SimpleResourceLoader(); |