OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/automation/automation_provider.h" | 5 #include "chrome/browser/automation/automation_provider.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/message_box_flags.h" | 10 #include "app/message_box_flags.h" |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 IPC_MESSAGE_HANDLER(AutomationMsg_GetBooleanPreference, | 411 IPC_MESSAGE_HANDLER(AutomationMsg_GetBooleanPreference, |
412 GetBooleanPreference) | 412 GetBooleanPreference) |
413 IPC_MESSAGE_HANDLER(AutomationMsg_SetBooleanPreference, | 413 IPC_MESSAGE_HANDLER(AutomationMsg_SetBooleanPreference, |
414 SetBooleanPreference) | 414 SetBooleanPreference) |
415 IPC_MESSAGE_HANDLER(AutomationMsg_GetPageCurrentEncoding, | 415 IPC_MESSAGE_HANDLER(AutomationMsg_GetPageCurrentEncoding, |
416 GetPageCurrentEncoding) | 416 GetPageCurrentEncoding) |
417 IPC_MESSAGE_HANDLER(AutomationMsg_OverrideEncoding, OverrideEncoding) | 417 IPC_MESSAGE_HANDLER(AutomationMsg_OverrideEncoding, OverrideEncoding) |
418 IPC_MESSAGE_HANDLER(AutomationMsg_SavePackageShouldPromptUser, | 418 IPC_MESSAGE_HANDLER(AutomationMsg_SavePackageShouldPromptUser, |
419 SavePackageShouldPromptUser) | 419 SavePackageShouldPromptUser) |
420 IPC_MESSAGE_HANDLER(AutomationMsg_WindowTitle, GetWindowTitle) | 420 IPC_MESSAGE_HANDLER(AutomationMsg_WindowTitle, GetWindowTitle) |
| 421 #if defined(OS_WIN) |
| 422 // Depends on ExternalTabContainer, so Windows-only |
421 IPC_MESSAGE_HANDLER(AutomationMsg_SetEnableExtensionAutomation, | 423 IPC_MESSAGE_HANDLER(AutomationMsg_SetEnableExtensionAutomation, |
422 SetEnableExtensionAutomation) | 424 SetEnableExtensionAutomation) |
| 425 #endif |
423 IPC_MESSAGE_HANDLER(AutomationMsg_SetShelfVisibility, SetShelfVisibility) | 426 IPC_MESSAGE_HANDLER(AutomationMsg_SetShelfVisibility, SetShelfVisibility) |
424 IPC_MESSAGE_HANDLER(AutomationMsg_BlockedPopupCount, GetBlockedPopupCount) | 427 IPC_MESSAGE_HANDLER(AutomationMsg_BlockedPopupCount, GetBlockedPopupCount) |
425 IPC_MESSAGE_HANDLER(AutomationMsg_SelectAll, SelectAll) | 428 IPC_MESSAGE_HANDLER(AutomationMsg_SelectAll, SelectAll) |
426 IPC_MESSAGE_HANDLER(AutomationMsg_Cut, Cut) | 429 IPC_MESSAGE_HANDLER(AutomationMsg_Cut, Cut) |
427 IPC_MESSAGE_HANDLER(AutomationMsg_Copy, Copy) | 430 IPC_MESSAGE_HANDLER(AutomationMsg_Copy, Copy) |
428 IPC_MESSAGE_HANDLER(AutomationMsg_Paste, Paste) | 431 IPC_MESSAGE_HANDLER(AutomationMsg_Paste, Paste) |
429 IPC_MESSAGE_HANDLER(AutomationMsg_ReloadAsync, ReloadAsync) | 432 IPC_MESSAGE_HANDLER(AutomationMsg_ReloadAsync, ReloadAsync) |
430 IPC_MESSAGE_HANDLER(AutomationMsg_StopAsync, StopAsync) | 433 IPC_MESSAGE_HANDLER(AutomationMsg_StopAsync, StopAsync) |
431 IPC_MESSAGE_HANDLER_DELAY_REPLY( | 434 IPC_MESSAGE_HANDLER_DELAY_REPLY( |
432 AutomationMsg_WaitForBrowserWindowCountToBecome, | 435 AutomationMsg_WaitForBrowserWindowCountToBecome, |
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 #else | 1926 #else |
1924 // TODO(port): Enable when encoding-related parts of Browser are ported. | 1927 // TODO(port): Enable when encoding-related parts of Browser are ported. |
1925 NOTIMPLEMENTED(); | 1928 NOTIMPLEMENTED(); |
1926 #endif | 1929 #endif |
1927 } | 1930 } |
1928 | 1931 |
1929 void AutomationProvider::SavePackageShouldPromptUser(bool should_prompt) { | 1932 void AutomationProvider::SavePackageShouldPromptUser(bool should_prompt) { |
1930 SavePackage::SetShouldPromptUser(should_prompt); | 1933 SavePackage::SetShouldPromptUser(should_prompt); |
1931 } | 1934 } |
1932 | 1935 |
1933 void AutomationProvider::SetEnableExtensionAutomation( | |
1934 const std::vector<std::string>& functions_enabled) { | |
1935 AutomationExtensionFunction::SetEnabled(functions_enabled); | |
1936 } | |
1937 | |
1938 void AutomationProvider::GetWindowTitle(int handle, string16* text) { | 1936 void AutomationProvider::GetWindowTitle(int handle, string16* text) { |
1939 gfx::NativeWindow window = window_tracker_->GetResource(handle); | 1937 gfx::NativeWindow window = window_tracker_->GetResource(handle); |
1940 text->assign(platform_util::GetWindowTitle(window)); | 1938 text->assign(platform_util::GetWindowTitle(window)); |
1941 } | 1939 } |
1942 | 1940 |
1943 void AutomationProvider::GetBlockedPopupCount(int handle, int* count) { | 1941 void AutomationProvider::GetBlockedPopupCount(int handle, int* count) { |
1944 *count = -1; // -1 is the error code | 1942 *count = -1; // -1 is the error code |
1945 if (tab_tracker_->ContainsHandle(handle)) { | 1943 if (tab_tracker_->ContainsHandle(handle)) { |
1946 NavigationController* nav_controller = tab_tracker_->GetResource(handle); | 1944 NavigationController* nav_controller = tab_tracker_->GetResource(handle); |
1947 TabContents* tab_contents = nav_controller->tab_contents(); | 1945 TabContents* tab_contents = nav_controller->tab_contents(); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2185 reply_message); | 2183 reply_message); |
2186 | 2184 |
2187 profile_->GetExtensionsService()->LoadExtension(extension_dir); | 2185 profile_->GetExtensionsService()->LoadExtension(extension_dir); |
2188 profile_->GetUserScriptMaster()->AddWatchedPath(extension_dir); | 2186 profile_->GetUserScriptMaster()->AddWatchedPath(extension_dir); |
2189 } else { | 2187 } else { |
2190 AutomationMsg_LoadExpandedExtension::WriteReplyParams( | 2188 AutomationMsg_LoadExpandedExtension::WriteReplyParams( |
2191 reply_message, AUTOMATION_MSG_EXTENSION_INSTALL_FAILED); | 2189 reply_message, AUTOMATION_MSG_EXTENSION_INSTALL_FAILED); |
2192 Send(reply_message); | 2190 Send(reply_message); |
2193 } | 2191 } |
2194 } | 2192 } |
OLD | NEW |