OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/devtools/renderer_overrides_handler.h" | 5 #include "content/browser/devtools/renderer_overrides_handler.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/barrier_closure.h" | 10 #include "base/barrier_closure.h" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 scoped_refptr<DevToolsProtocol::Command> command) { | 360 scoped_refptr<DevToolsProtocol::Command> command) { |
361 RenderViewHost* host = agent_->GetRenderViewHost(); | 361 RenderViewHost* host = agent_->GetRenderViewHost(); |
362 if (host) { | 362 if (host) { |
363 WebContents* web_contents = host->GetDelegate()->GetAsWebContents(); | 363 WebContents* web_contents = host->GetDelegate()->GetAsWebContents(); |
364 if (web_contents) { | 364 if (web_contents) { |
365 base::DictionaryValue* result = new base::DictionaryValue(); | 365 base::DictionaryValue* result = new base::DictionaryValue(); |
366 NavigationController& controller = web_contents->GetController(); | 366 NavigationController& controller = web_contents->GetController(); |
367 result->SetInteger( | 367 result->SetInteger( |
368 devtools::Page::getNavigationHistory::kResponseCurrentIndex, | 368 devtools::Page::getNavigationHistory::kResponseCurrentIndex, |
369 controller.GetCurrentEntryIndex()); | 369 controller.GetCurrentEntryIndex()); |
370 ListValue* entries = new ListValue(); | 370 base::ListValue* entries = new base::ListValue(); |
371 for (int i = 0; i != controller.GetEntryCount(); ++i) { | 371 for (int i = 0; i != controller.GetEntryCount(); ++i) { |
372 const NavigationEntry* entry = controller.GetEntryAtIndex(i); | 372 const NavigationEntry* entry = controller.GetEntryAtIndex(i); |
373 base::DictionaryValue* entry_value = new base::DictionaryValue(); | 373 base::DictionaryValue* entry_value = new base::DictionaryValue(); |
374 entry_value->SetInteger( | 374 entry_value->SetInteger( |
375 devtools::Page::NavigationEntry::kParamId, | 375 devtools::Page::NavigationEntry::kParamId, |
376 entry->GetUniqueID()); | 376 entry->GetUniqueID()); |
377 entry_value->SetString( | 377 entry_value->SetString( |
378 devtools::Page::NavigationEntry::kParamUrl, | 378 devtools::Page::NavigationEntry::kParamUrl, |
379 entry->GetURL().spec()); | 379 entry->GetURL().spec()); |
380 entry_value->SetString( | 380 entry_value->SetString( |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 return NULL; | 970 return NULL; |
971 } | 971 } |
972 event.data.pinchUpdate.scale = static_cast<float>(scale); | 972 event.data.pinchUpdate.scale = static_cast<float>(scale); |
973 } | 973 } |
974 | 974 |
975 host->ForwardGestureEvent(event); | 975 host->ForwardGestureEvent(event); |
976 return command->SuccessResponse(NULL); | 976 return command->SuccessResponse(NULL); |
977 } | 977 } |
978 | 978 |
979 } // namespace content | 979 } // namespace content |
OLD | NEW |