diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 17:01:05 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 17:01:05 +0000 |
commit | f83f910cdbab68232528eb99730e80181709fae0 (patch) | |
tree | 2a924db0f6fc66fe5599a565fe2e113cbe2e2f98 | |
parent | ac4bf50fc19c4111726db37478a7d5be6132b562 (diff) | |
download | chromium_src-f83f910cdbab68232528eb99730e80181709fae0.zip chromium_src-f83f910cdbab68232528eb99730e80181709fae0.tar.gz chromium_src-f83f910cdbab68232528eb99730e80181709fae0.tar.bz2 |
Enable more parts of automation on all platforms:
- overriding encoding
- printing
Initially we couldn't compile them on all platforms,
now it's possible. Overriding of encoding works fully
everywhere (this also enables a test for that),
printing might hit some NOTIMPLEMENTEDs on non-Windows
platforms.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/1943001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46359 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 4 insertions, 29 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index e8cab61..b43ef22 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -37,11 +37,13 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_window.h" #include "chrome/browser/browsing_data_remover.h" +#include "chrome/browser/character_encoding.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/dom_operation_notification_details.h" #include "chrome/browser/debugger/devtools_manager.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_shelf.h" +#include "chrome/browser/download/save_package.h" #include "chrome/browser/extensions/crx_installer.h" #include "chrome/browser/extensions/extension_browser_event_router.h" #include "chrome/browser/extensions/extension_install_ui.h" @@ -61,6 +63,7 @@ #include "chrome/browser/net/url_request_mock_util.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/pref_service.h" +#include "chrome/browser/printing/print_job.h" #include "chrome/browser/profile_manager.h" #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/render_view_host.h" @@ -84,11 +87,7 @@ #include "views/event.h" #if defined(OS_WIN) -// TODO(port): Port these headers. -#include "chrome/browser/character_encoding.h" -#include "chrome/browser/download/save_package.h" #include "chrome/browser/external_tab_container.h" -#include "chrome/browser/printing/print_job.h" #endif // defined(OS_WIN) using base::Time; @@ -2216,7 +2215,6 @@ void AutomationProvider::IsPageMenuCommandEnabled(int browser_handle, void AutomationProvider::PrintNow(int tab_handle, IPC::Message* reply_message) { -#if defined(OS_WIN) NavigationController* tab = NULL; TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab); if (tab_contents) { @@ -2228,10 +2226,6 @@ void AutomationProvider::PrintNow(int tab_handle, } AutomationMsg_PrintNow::WriteReplyParams(reply_message, false); Send(reply_message); -#else - // TODO(port): Remove once DocumentPrintedNotificationObserver is implemented. - NOTIMPLEMENTED(); -#endif // defined(OS_WIN) } void AutomationProvider::SavePage(int tab_handle, @@ -2570,7 +2564,6 @@ void AutomationProvider::OverrideEncoding(int tab_handle, const std::string& encoding_name, bool* success) { *success = false; -#if defined(OS_WIN) if (tab_tracker_->ContainsHandle(tab_handle)) { NavigationController* nav = tab_tracker_->GetResource(tab_handle); if (!nav) @@ -2600,10 +2593,6 @@ void AutomationProvider::OverrideEncoding(int tab_handle, contents->SetOverrideEncoding(selected_encoding); } } -#else - // TODO(port): Enable when encoding-related parts of Browser are ported. - NOTIMPLEMENTED(); -#endif } void AutomationProvider::SavePackageShouldPromptUser(bool should_prompt) { diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index 1c26ae7..eb8e247 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -16,6 +16,7 @@ #include "chrome/browser/extensions/extension_updater.h" #include "chrome/browser/login_prompt.h" #include "chrome/browser/metrics/metric_event_duration_details.h" +#include "chrome/browser/printing/print_job.h" #include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/tab_contents/tab_contents.h" @@ -23,10 +24,6 @@ #include "chrome/common/notification_service.h" #include "chrome/test/automation/automation_constants.h" -#if defined(OS_WIN) -#include "chrome/browser/printing/print_job.h" -#endif // defined(OS_WIN) - #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/login/authentication_notification_details.h" #endif @@ -811,8 +808,6 @@ void DomOperationNotificationObserver::Observe( } } -#if defined(OS_WIN) -// TODO(port): Enable when printing is ported. DocumentPrintedNotificationObserver::DocumentPrintedNotificationObserver( AutomationProvider* automation, IPC::Message* reply_message) : automation_(automation), @@ -863,7 +858,6 @@ void DocumentPrintedNotificationObserver::Observe( } } } -#endif // defined(OS_WIN) MetricEventDurationObserver::MetricEventDurationObserver() { registrar_.Add(this, NotificationType::METRIC_EVENT_DURATION, diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h index e6a082e..efb01e0 100644 --- a/chrome/browser/automation/automation_provider_observers.h +++ b/chrome/browser/automation/automation_provider_observers.h @@ -428,8 +428,6 @@ class DomOperationNotificationObserver : public NotificationObserver { DISALLOW_COPY_AND_ASSIGN(DomOperationNotificationObserver); }; -#if defined(OS_WIN) -// TODO(port): Enable when printing is ported. class DocumentPrintedNotificationObserver : public NotificationObserver { public: DocumentPrintedNotificationObserver(AutomationProvider* automation, @@ -447,7 +445,6 @@ class DocumentPrintedNotificationObserver : public NotificationObserver { DISALLOW_COPY_AND_ASSIGN(DocumentPrintedNotificationObserver); }; -#endif // defined(OS_WIN) // Collects METRIC_EVENT_DURATION notifications and keep track of the times. class MetricEventDurationObserver : public NotificationObserver { diff --git a/chrome/browser/browser_encoding_uitest.cc b/chrome/browser/browser_encoding_uitest.cc index 1669136..3c0531b 100644 --- a/chrome/browser/browser_encoding_uitest.cc +++ b/chrome/browser/browser_encoding_uitest.cc @@ -109,10 +109,6 @@ TEST_F(BrowserEncodingTest, TestEncodingAliasMapping) { } } -#if defined(OS_WIN) -// We are disabling this test on MacOS and Linux because on those platforms -// AutomationProvider::OverrideEncoding is not implemented yet. -// TODO(port): Enable when encoding-related parts of Browser are ported. TEST_F(BrowserEncodingTest, TestOverrideEncoding) { const char* const kTestFileName = "gb18030_with_iso88591_meta.html"; const char* const kExpectedFileName = @@ -157,7 +153,6 @@ TEST_F(BrowserEncodingTest, TestOverrideEncoding) { expected_file_name = expected_file_name.AppendASCII(kExpectedFileName); CheckFile(full_file_name, expected_file_name, true); } -#endif // defined(OS_WIN) // The following encodings are excluded from the auto-detection test because // it's a known issue that the current encoding detector does not detect them: |