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

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

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_ui_bindings.h" 5 #include "chrome/browser/devtools/devtools_ui_bindings.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 file_system_path)); 684 file_system_path));
685 } 685 }
686 686
687 void DevToolsUIBindings::SetWhitelistedShortcuts(const std::string& message) { 687 void DevToolsUIBindings::SetWhitelistedShortcuts(const std::string& message) {
688 delegate_->SetWhitelistedShortcuts(message); 688 delegate_->SetWhitelistedShortcuts(message);
689 } 689 }
690 690
691 void DevToolsUIBindings::ShowCertificateViewer(const std::string& cert_chain) { 691 void DevToolsUIBindings::ShowCertificateViewer(const std::string& cert_chain) {
692 std::unique_ptr<base::Value> value = 692 std::unique_ptr<base::Value> value =
693 base::JSONReader::Read(cert_chain); 693 base::JSONReader::Read(cert_chain);
694 if (!value || value->GetType() != base::Value::TYPE_LIST) { 694 if (!value || value->GetType() != base::Value::Type::LIST) {
695 NOTREACHED(); 695 NOTREACHED();
696 return; 696 return;
697 } 697 }
698 698
699 std::unique_ptr<base::ListValue> list = 699 std::unique_ptr<base::ListValue> list =
700 base::ListValue::From(std::move(value)); 700 base::ListValue::From(std::move(value));
701 std::vector<std::string> decoded; 701 std::vector<std::string> decoded;
702 for (size_t i = 0; i < list->GetSize(); ++i) { 702 for (size_t i = 0; i < list->GetSize(); ++i) {
703 base::Value* item; 703 base::Value* item;
704 if (!list->Get(i, &item) || item->GetType() != base::Value::TYPE_STRING) { 704 if (!list->Get(i, &item) || item->GetType() != base::Value::Type::STRING) {
705 NOTREACHED(); 705 NOTREACHED();
706 return; 706 return;
707 } 707 }
708 std::string temp; 708 std::string temp;
709 if (!item->GetAsString(&temp)) { 709 if (!item->GetAsString(&temp)) {
710 NOTREACHED(); 710 NOTREACHED();
711 return; 711 return;
712 } 712 }
713 if (!base::Base64Decode(temp, &temp)) { 713 if (!base::Base64Decode(temp, &temp)) {
714 NOTREACHED(); 714 NOTREACHED();
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 void DevToolsUIBindings::FrontendLoaded() { 1186 void DevToolsUIBindings::FrontendLoaded() {
1187 if (frontend_loaded_) 1187 if (frontend_loaded_)
1188 return; 1188 return;
1189 frontend_loaded_ = true; 1189 frontend_loaded_ = true;
1190 1190
1191 // Call delegate first - it seeds importants bit of information. 1191 // Call delegate first - it seeds importants bit of information.
1192 delegate_->OnLoadCompleted(); 1192 delegate_->OnLoadCompleted();
1193 1193
1194 AddDevToolsExtensionsToClient(); 1194 AddDevToolsExtensionsToClient();
1195 } 1195 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_protocol.cc ('k') | chrome/browser/devtools/devtools_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698