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 |
178 bool BrowserProxy::ApplyAccelerator(int id) { | 211 bool BrowserProxy::ApplyAccelerator(int id) { |
179 return RunCommandAsync(id); | 212 return RunCommandAsync(id); |
180 } | 213 } |
181 | 214 |
182 bool BrowserProxy::SimulateDrag(const gfx::Point& start, | 215 bool BrowserProxy::SimulateDrag(const gfx::Point& start, |
183 const gfx::Point& end, | 216 const gfx::Point& end, |
184 int flags, | 217 int flags, |
185 bool press_escape_en_route) { | 218 bool press_escape_en_route) { |
186 return SimulateDragWithTimeout(start, end, flags, base::kNoTimeout, NULL, | 219 return SimulateDragWithTimeout(start, end, flags, base::kNoTimeout, NULL, |
187 press_escape_en_route); | 220 press_escape_en_route); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 if (!p) { | 466 if (!p) { |
434 p = new AutocompleteEditProxy(sender_, tracker_, autocomplete_edit_handle); | 467 p = new AutocompleteEditProxy(sender_, tracker_, autocomplete_edit_handle); |
435 p->AddRef(); | 468 p->AddRef(); |
436 } | 469 } |
437 | 470 |
438 // Since there is no scoped_refptr::attach. | 471 // Since there is no scoped_refptr::attach. |
439 scoped_refptr<AutocompleteEditProxy> result; | 472 scoped_refptr<AutocompleteEditProxy> result; |
440 result.swap(&p); | 473 result.swap(&p); |
441 return result; | 474 return result; |
442 } | 475 } |
OLD | NEW |