OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/test/automation/browser_proxy.h" | 5 #include "chrome/test/automation/browser_proxy.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/gfx/point.h" | 9 #include "base/gfx/point.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 if (tab_count_response >= 0) { | 169 if (tab_count_response >= 0) { |
170 *num_tabs = tab_count_response; | 170 *num_tabs = tab_count_response; |
171 } else { | 171 } else { |
172 succeeded = false; | 172 succeeded = false; |
173 } | 173 } |
174 | 174 |
175 return succeeded; | 175 return succeeded; |
176 } | 176 } |
177 | 177 |
178 bool BrowserProxy::GetType(Type* type) const { | |
179 if (!is_valid()) | |
180 return false; | |
181 | |
182 if (!type) { | |
183 NOTREACHED(); | |
184 return false; | |
185 } | |
186 | |
187 int type_as_int; | |
188 bool succeeded = sender_->SendWithTimeout(new AutomationMsg_Type( | |
189 0, handle_, &type_as_int), base::kNoTimeout, NULL); | |
190 | |
191 switch (type_as_int) { | |
192 case 0: | |
193 *type = TYPE_NORMAL; | |
194 break; | |
195 case 1: | |
196 *type = TYPE_POPUP; | |
197 break; | |
198 case 2: | |
199 *type = TYPE_APP; | |
200 break; | |
201 case 3: | |
202 *type = TYPE_APP_POPUP; | |
203 break; | |
204 default: | |
205 return false; | |
206 } | |
207 | |
208 return succeeded; | |
209 } | |
210 | |
211 bool BrowserProxy::ApplyAccelerator(int id) { | 178 bool BrowserProxy::ApplyAccelerator(int id) { |
212 return RunCommandAsync(id); | 179 return RunCommandAsync(id); |
213 } | 180 } |
214 | 181 |
215 bool BrowserProxy::SimulateDrag(const gfx::Point& start, | 182 bool BrowserProxy::SimulateDrag(const gfx::Point& start, |
216 const gfx::Point& end, | 183 const gfx::Point& end, |
217 int flags, | 184 int flags, |
218 bool press_escape_en_route) { | 185 bool press_escape_en_route) { |
219 return SimulateDragWithTimeout(start, end, flags, base::kNoTimeout, NULL, | 186 return SimulateDragWithTimeout(start, end, flags, base::kNoTimeout, NULL, |
220 press_escape_en_route); | 187 press_escape_en_route); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 if (!p) { | 433 if (!p) { |
467 p = new AutocompleteEditProxy(sender_, tracker_, autocomplete_edit_handle); | 434 p = new AutocompleteEditProxy(sender_, tracker_, autocomplete_edit_handle); |
468 p->AddRef(); | 435 p->AddRef(); |
469 } | 436 } |
470 | 437 |
471 // Since there is no scoped_refptr::attach. | 438 // Since there is no scoped_refptr::attach. |
472 scoped_refptr<AutocompleteEditProxy> result; | 439 scoped_refptr<AutocompleteEditProxy> result; |
473 result.swap(&p); | 440 result.swap(&p); |
474 return result; | 441 return result; |
475 } | 442 } |
OLD | NEW |