| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webdriver/commands/chrome_commands.h" | 5 #include "chrome/test/webdriver/commands/chrome_commands.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 std::vector<WebViewInfo> views; | 239 std::vector<WebViewInfo> views; |
| 240 Error* error = session_->GetViews(&views); | 240 Error* error = session_->GetViews(&views); |
| 241 if (error) { | 241 if (error) { |
| 242 response->SetError(error); | 242 response->SetError(error); |
| 243 return; | 243 return; |
| 244 } | 244 } |
| 245 ListValue* views_list = new ListValue(); | 245 ListValue* views_list = new ListValue(); |
| 246 for (size_t i = 0; i < views.size(); ++i) { | 246 for (size_t i = 0; i < views.size(); ++i) { |
| 247 DictionaryValue* dict = new DictionaryValue(); | 247 DictionaryValue* dict = new DictionaryValue(); |
| 248 AutomationId id = views[i].view_id.GetId(); | 248 AutomationId id = views[i].view_id.GetId(); |
| 249 dict->SetString("handle", JsonStringify(id.ToValue())); | 249 dict->SetString("handle", WebViewIdToString(WebViewId::ForView(id))); |
| 250 dict->SetInteger("type", id.type()); | 250 dict->SetInteger("type", id.type()); |
| 251 if (!views[i].extension_id.empty()) | 251 if (!views[i].extension_id.empty()) |
| 252 dict->SetString("extension_id", views[i].extension_id); | 252 dict->SetString("extension_id", views[i].extension_id); |
| 253 views_list->Append(dict); | 253 views_list->Append(dict); |
| 254 } | 254 } |
| 255 response->SetValue(views_list); | 255 response->SetValue(views_list); |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace webdriver | 258 } // namespace webdriver |
| OLD | NEW |