| 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 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 Browser* browser = browser_tracker_->GetResource(handle); | 1137 Browser* browser = browser_tracker_->GetResource(handle); |
| 1138 browser->FindInPage(false, false); | 1138 browser->FindInPage(false, false); |
| 1139 } | 1139 } |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 void AutomationProvider::GetFindWindowVisibility(int handle, bool* visible) { | 1142 void AutomationProvider::GetFindWindowVisibility(int handle, bool* visible) { |
| 1143 *visible = false; | 1143 *visible = false; |
| 1144 Browser* browser = browser_tracker_->GetResource(handle); | 1144 Browser* browser = browser_tracker_->GetResource(handle); |
| 1145 if (browser) { | 1145 if (browser) { |
| 1146 FindBarTesting* find_bar = | 1146 FindBarTesting* find_bar = |
| 1147 browser->GetFindBarController()->find_bar()->GetFindBarTesting(); | 1147 browser->find_bar()->find_bar()->GetFindBarTesting(); |
| 1148 find_bar->GetFindBarWindowInfo(NULL, visible); | 1148 find_bar->GetFindBarWindowInfo(NULL, visible); |
| 1149 } | 1149 } |
| 1150 } | 1150 } |
| 1151 | 1151 |
| 1152 void AutomationProvider::HandleFindWindowLocationRequest(int handle, int* x, | 1152 void AutomationProvider::HandleFindWindowLocationRequest(int handle, int* x, |
| 1153 int* y) { | 1153 int* y) { |
| 1154 gfx::Point position(0, 0); | 1154 gfx::Point position(0, 0); |
| 1155 bool visible = false; | 1155 bool visible = false; |
| 1156 if (browser_tracker_->ContainsHandle(handle)) { | 1156 if (browser_tracker_->ContainsHandle(handle)) { |
| 1157 Browser* browser = browser_tracker_->GetResource(handle); | 1157 Browser* browser = browser_tracker_->GetResource(handle); |
| 1158 FindBarTesting* find_bar = | 1158 FindBarTesting* find_bar = |
| 1159 browser->GetFindBarController()->find_bar()->GetFindBarTesting(); | 1159 browser->find_bar()->find_bar()->GetFindBarTesting(); |
| 1160 find_bar->GetFindBarWindowInfo(&position, &visible); | 1160 find_bar->GetFindBarWindowInfo(&position, &visible); |
| 1161 } | 1161 } |
| 1162 | 1162 |
| 1163 *x = position.x(); | 1163 *x = position.x(); |
| 1164 *y = position.y(); | 1164 *y = position.y(); |
| 1165 } | 1165 } |
| 1166 | 1166 |
| 1167 void AutomationProvider::HandleInspectElementRequest( | 1167 void AutomationProvider::HandleInspectElementRequest( |
| 1168 int handle, int x, int y, IPC::Message* reply_message) { | 1168 int handle, int x, int y, IPC::Message* reply_message) { |
| 1169 TabContents* tab_contents = GetTabContentsForHandle(handle, NULL); | 1169 TabContents* tab_contents = GetTabContentsForHandle(handle, NULL); |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2159 reply_message); | 2159 reply_message); |
| 2160 | 2160 |
| 2161 profile_->GetExtensionsService()->LoadExtension(extension_dir); | 2161 profile_->GetExtensionsService()->LoadExtension(extension_dir); |
| 2162 profile_->GetUserScriptMaster()->AddWatchedPath(extension_dir); | 2162 profile_->GetUserScriptMaster()->AddWatchedPath(extension_dir); |
| 2163 } else { | 2163 } else { |
| 2164 AutomationMsg_LoadExpandedExtension::WriteReplyParams( | 2164 AutomationMsg_LoadExpandedExtension::WriteReplyParams( |
| 2165 reply_message, AUTOMATION_MSG_EXTENSION_INSTALL_FAILED); | 2165 reply_message, AUTOMATION_MSG_EXTENSION_INSTALL_FAILED); |
| 2166 Send(reply_message); | 2166 Send(reply_message); |
| 2167 } | 2167 } |
| 2168 } | 2168 } |
| OLD | NEW |