diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-06 23:20:14 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-06 23:20:14 +0000 |
commit | 40d59ce5843802c4bc5fa667890334cbc040252e (patch) | |
tree | d51a5db86d9aa9efdd47fa2fbfa2e78e6bb1859f /chrome | |
parent | d5dbf9d9ccad36a514e89b49f7644252a3fa7682 (diff) | |
download | chromium_src-40d59ce5843802c4bc5fa667890334cbc040252e.zip chromium_src-40d59ce5843802c4bc5fa667890334cbc040252e.tar.gz chromium_src-40d59ce5843802c4bc5fa667890334cbc040252e.tar.bz2 |
Enable the character encoding menu, zoom menu, and the help menu item.
The character encoding menu is still broken in that it doesn't load the
encoding names (sub-menu items), but auto detect might work.
Review URL: http://codereview.chromium.org/39286
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11174 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser.cc | 16 | ||||
-rw-r--r-- | chrome/browser/browser.h | 6 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents.cc | 2 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.h | 9 |
4 files changed, 18 insertions, 15 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 8d30d28..81067b0 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -13,6 +13,7 @@ #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_shutdown.h" #include "chrome/browser/browser_window.h" +#include "chrome/browser/character_encoding.h" #include "chrome/browser/dom_ui/new_tab_ui.h" #include "chrome/browser/location_bar.h" #include "chrome/browser/metrics/user_metrics.h" @@ -56,7 +57,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_url_handler.h" #include "chrome/browser/cert_store.h" -#include "chrome/browser/character_encoding.h" #include "chrome/browser/debugger/debugger_window.h" #include "chrome/browser/dock_info.h" #include "chrome/browser/dom_ui/downloads_ui.h" @@ -783,6 +783,7 @@ void Browser::Print() { UserMetrics::RecordAction(L"PrintPreview", profile_); GetSelectedTabContents()->AsWebContents()->PrintPreview(); } +#endif // #if defined(OS_WIN) void Browser::ToggleEncodingAutoDetect() { UserMetrics::RecordAction(L"AutoDetectChange", profile_); @@ -809,6 +810,7 @@ void Browser::OverrideEncoding(int encoding_id) { } } +#if defined(OS_WIN) // TODO(devint): http://b/issue?id=1117225 Cut, Copy, and Paste are always // enabled in the page menu regardless of whether the command will do // anything. When someone selects the menu item, we just act as if they hit @@ -870,6 +872,7 @@ void Browser::FindPrevious() { UserMetrics::RecordAction(L"FindPrevious", profile_); FindInPage(true, false); } +#endif // #if defined(OS_WIN) void Browser::ZoomIn() { UserMetrics::RecordAction(L"ZoomPlus", profile_); @@ -889,6 +892,7 @@ void Browser::ZoomOut() { PageZoom::SMALLER); } +#if defined(OS_WIN) void Browser::FocusToolbar() { UserMetrics::RecordAction(L"FocusToolbar", profile_); window_->FocusToolbar(); @@ -1015,14 +1019,14 @@ void Browser::OpenAboutChromeDialog() { UserMetrics::RecordAction(L"AboutChrome", profile_); window_->ShowAboutChromeDialog(); } +#endif void Browser::OpenHelpTab() { - GURL help_url(l10n_util::GetString(IDS_HELP_CONTENT_URL)); + GURL help_url(WideToASCII(l10n_util::GetString(IDS_HELP_CONTENT_URL))); AddTabWithURL(help_url, GURL(), PageTransition::AUTO_BOOKMARK, true, NULL); } -#endif /////////////////////////////////////////////////////////////////////////////// // static @@ -1135,6 +1139,7 @@ void Browser::ExecuteCommand(int id) { #if defined(OS_WIN) case IDC_CLOSE_POPUPS: ClosePopups(); break; case IDC_PRINT: Print(); break; +#endif case IDC_ENCODING_AUTO_DETECT: ToggleEncodingAutoDetect(); break; case IDC_ENCODING_UTF8: case IDC_ENCODING_UTF16LE: @@ -1173,6 +1178,7 @@ void Browser::ExecuteCommand(int id) { case IDC_ENCODING_WINDOWS1255: case IDC_ENCODING_WINDOWS1258: OverrideEncoding(id); break; +#if defined(OS_WIN) // Clipboard commands case IDC_CUT: Cut(); break; case IDC_COPY: Copy(); break; @@ -1183,12 +1189,14 @@ void Browser::ExecuteCommand(int id) { case IDC_FIND: Find(); break; case IDC_FIND_NEXT: FindNext(); break; case IDC_FIND_PREVIOUS: FindPrevious(); break; +#endif // Zoom case IDC_ZOOM_PLUS: ZoomIn(); break; case IDC_ZOOM_NORMAL: ZoomReset(); break; case IDC_ZOOM_MINUS: ZoomOut(); break; +#if defined(OS_WIN) // Focus various bits of UI case IDC_FOCUS_TOOLBAR: FocusToolbar(); break; case IDC_FOCUS_LOCATION: FocusLocationBar(); break; @@ -1217,8 +1225,8 @@ void Browser::ExecuteCommand(int id) { case IDC_EDIT_SEARCH_ENGINES: OpenKeywordEditor(); break; case IDC_VIEW_PASSWORDS: OpenPasswordManager(); break; case IDC_ABOUT: OpenAboutChromeDialog(); break; - case IDC_HELP_PAGE: OpenHelpTab(); break; #endif + case IDC_HELP_PAGE: OpenHelpTab(); break; default: LOG(WARNING) << "Received Unimplemented Command: " << id; diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index df519a1..920a488 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -275,9 +275,11 @@ class Browser : public TabStripModelDelegate, // Page-related commands. void ClosePopups(); void Print(); +#endif void ToggleEncodingAutoDetect(); void OverrideEncoding(int encoding_id); +#if defined(OS_WIN) // Clipboard commands void Cut(); void Copy(); @@ -288,12 +290,14 @@ class Browser : public TabStripModelDelegate, void Find(); void FindNext(); void FindPrevious(); +#endif // Zoom void ZoomIn(); void ZoomReset(); void ZoomOut(); +#if defined(OS_WIN) // Focus various bits of UI void FocusToolbar(); void FocusLocationBar(); @@ -317,8 +321,8 @@ class Browser : public TabStripModelDelegate, void OpenKeywordEditor(); void OpenPasswordManager(); void OpenAboutChromeDialog(); - void OpenHelpTab(); #endif + void OpenHelpTab(); ///////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc index 55c3180..affa867 100644 --- a/chrome/browser/tab_contents/web_contents.cc +++ b/chrome/browser/tab_contents/web_contents.cc @@ -12,6 +12,7 @@ #include "chrome/browser/autofill_manager.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/browser.h" +#include "chrome/browser/character_encoding.h" #include "chrome/browser/dom_operation_notification_details.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/gears_integration.h" @@ -46,7 +47,6 @@ #if defined(OS_WIN) // TODO(port): fill these in as we flesh out the implementation of this class #include "chrome/browser/cache_manager_host.h" -#include "chrome/browser/character_encoding.h" #include "chrome/browser/download/download_request_manager.h" #include "chrome/browser/modal_html_dialog_delegate.h" #include "chrome/browser/plugin_service.h" diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index 3452925..22b220c 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -686,15 +686,6 @@ class HtmlDialogContents { }; }; -class CharacterEncoding { - public: - static std::wstring GetCanonicalEncodingNameByAliasName( - const std::wstring&) { - NOTIMPLEMENTED(); - return L""; - } -}; - #if defined(OS_MACOSX) class FindBarMac { public: |