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_frame/chrome_frame_automation.h" | 5 #include "chrome_frame/chrome_frame_automation.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/file_version_info.h" | 10 #include "base/file_version_info.h" |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 | 746 |
747 PostTask(FROM_HERE, NewRunnableMethod(this, | 747 PostTask(FROM_HERE, NewRunnableMethod(this, |
748 &ChromeFrameAutomationClient::InitializeComplete, launch_result)); | 748 &ChromeFrameAutomationClient::InitializeComplete, launch_result)); |
749 } | 749 } |
750 | 750 |
751 void ChromeFrameAutomationClient::SetEnableExtensionAutomation( | 751 void ChromeFrameAutomationClient::SetEnableExtensionAutomation( |
752 const std::vector<std::string>& functions_enabled) { | 752 const std::vector<std::string>& functions_enabled) { |
753 if (!is_initialized()) | 753 if (!is_initialized()) |
754 return; | 754 return; |
755 | 755 |
756 automation_server_->SetEnableExtensionAutomation(functions_enabled); | 756 // We are doing initialization, so there is no need to reset extension |
| 757 // automation, only to set it. Also, we want to avoid resetting extension |
| 758 // automation that some other automation client has set up. Therefore only |
| 759 // send the message if we are going to enable automation of some functions. |
| 760 if (functions_enabled.size() > 0) { |
| 761 tab_->SetEnableExtensionAutomation(functions_enabled); |
| 762 } |
757 } | 763 } |
758 | 764 |
759 // Invoked in launch background thread. | 765 // Invoked in launch background thread. |
760 void ChromeFrameAutomationClient::LaunchComplete( | 766 void ChromeFrameAutomationClient::LaunchComplete( |
761 ChromeFrameAutomationProxy* proxy, | 767 ChromeFrameAutomationProxy* proxy, |
762 AutomationLaunchResult result) { | 768 AutomationLaunchResult result) { |
763 // If we're shutting down we don't keep a pointer to the automation server. | 769 // If we're shutting down we don't keep a pointer to the automation server. |
764 if (init_state_ != UNINITIALIZING) { | 770 if (init_state_ != UNINITIALIZING) { |
765 DCHECK(init_state_ == INITIALIZING); | 771 DCHECK(init_state_ == INITIALIZING); |
766 automation_server_ = proxy; | 772 automation_server_ = proxy; |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 if (font_size < SMALLEST_FONT || | 1112 if (font_size < SMALLEST_FONT || |
1107 font_size > LARGEST_FONT) { | 1113 font_size > LARGEST_FONT) { |
1108 NOTREACHED() << "Invalid font size specified : " | 1114 NOTREACHED() << "Invalid font size specified : " |
1109 << font_size; | 1115 << font_size; |
1110 return; | 1116 return; |
1111 } | 1117 } |
1112 | 1118 |
1113 Send(new AutomationMsg_SetPageFontSize(0, tab_handle_, font_size)); | 1119 Send(new AutomationMsg_SetPageFontSize(0, tab_handle_, font_size)); |
1114 } | 1120 } |
1115 | 1121 |
OLD | NEW |