Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: chrome/browser/devtools/devtools_window.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/devtools/devtools_window.h" 5 #include "chrome/browser/devtools/devtools_window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 void DevToolsEventForwarder::SetWhitelistedShortcuts( 251 void DevToolsEventForwarder::SetWhitelistedShortcuts(
252 const std::string& message) { 252 const std::string& message) {
253 std::unique_ptr<base::Value> parsed_message = base::JSONReader::Read(message); 253 std::unique_ptr<base::Value> parsed_message = base::JSONReader::Read(message);
254 base::ListValue* shortcut_list; 254 base::ListValue* shortcut_list;
255 if (!parsed_message || !parsed_message->GetAsList(&shortcut_list)) 255 if (!parsed_message || !parsed_message->GetAsList(&shortcut_list))
256 return; 256 return;
257 base::ListValue::iterator it = shortcut_list->begin(); 257 base::ListValue::iterator it = shortcut_list->begin();
258 for (; it != shortcut_list->end(); ++it) { 258 for (; it != shortcut_list->end(); ++it) {
259 base::DictionaryValue* dictionary; 259 base::DictionaryValue* dictionary;
260 if (!it->GetAsDictionary(&dictionary)) 260 if (!(*it)->GetAsDictionary(&dictionary))
261 continue; 261 continue;
262 int key_code = 0; 262 int key_code = 0;
263 dictionary->GetInteger("keyCode", &key_code); 263 dictionary->GetInteger("keyCode", &key_code);
264 if (key_code == 0) 264 if (key_code == 0)
265 continue; 265 continue;
266 int modifiers = 0; 266 int modifiers = 0;
267 dictionary->GetInteger("modifiers", &modifiers); 267 dictionary->GetInteger("modifiers", &modifiers);
268 if (!KeyWhitelistingAllowed(key_code, modifiers)) { 268 if (!KeyWhitelistingAllowed(key_code, modifiers)) {
269 LOG(WARNING) << "Key whitelisting forbidden: " 269 LOG(WARNING) << "Key whitelisting forbidden: "
270 << "(" << key_code << "," << modifiers << ")"; 270 << "(" << key_code << "," << modifiers << ")";
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { 1409 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) {
1410 // Only route reload via front-end if the agent is attached. 1410 // Only route reload via front-end if the agent is attached.
1411 WebContents* wc = GetInspectedWebContents(); 1411 WebContents* wc = GetInspectedWebContents();
1412 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) 1412 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING)
1413 return false; 1413 return false;
1414 base::Value bypass_cache_value(bypass_cache); 1414 base::Value bypass_cache_value(bypass_cache);
1415 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", 1415 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage",
1416 &bypass_cache_value, nullptr, nullptr); 1416 &bypass_cache_value, nullptr, nullptr);
1417 return true; 1417 return true;
1418 } 1418 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698