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

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

Issue 418243003: [DevTools] Move DispatchOnDevToolsFrontend to embedder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/devtools/devtools_frontend_host_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 405
406 void DevToolsUIBindings::HandleMessageFromDevToolsFrontendToBackend( 406 void DevToolsUIBindings::HandleMessageFromDevToolsFrontendToBackend(
407 const std::string& message) { 407 const std::string& message) {
408 content::DevToolsManager::GetInstance()->DispatchOnInspectorBackend( 408 content::DevToolsManager::GetInstance()->DispatchOnInspectorBackend(
409 this, message); 409 this, message);
410 } 410 }
411 411
412 // content::DevToolsClientHost implementation --------------------------------- 412 // content::DevToolsClientHost implementation ---------------------------------
413 void DevToolsUIBindings::DispatchOnInspectorFrontend( 413 void DevToolsUIBindings::DispatchOnInspectorFrontend(
414 const std::string& message) { 414 const std::string& message) {
415 if (frontend_host_) 415 base::StringValue message_value(message);
416 frontend_host_->DispatchOnDevToolsFrontend(message); 416 CallClientFunction("InspectorFrontendAPI.dispatchMessage",
417 &message_value, NULL, NULL);
417 } 418 }
418 419
419 void DevToolsUIBindings::InspectedContentsClosing() { 420 void DevToolsUIBindings::InspectedContentsClosing() {
420 delegate_->InspectedContentsClosing(); 421 delegate_->InspectedContentsClosing();
421 } 422 }
422 423
423 void DevToolsUIBindings::ReplacedWithAnotherClient() { 424 void DevToolsUIBindings::ReplacedWithAnotherClient() {
424 } 425 }
425 426
426 // DevToolsEmbedderMessageDispatcher::Delegate implementation ----------------- 427 // DevToolsEmbedderMessageDispatcher::Delegate implementation -----------------
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 params.append(json); 798 params.append(json);
798 if (arg2) { 799 if (arg2) {
799 base::JSONWriter::Write(arg2, &json); 800 base::JSONWriter::Write(arg2, &json);
800 params.append(", " + json); 801 params.append(", " + json);
801 if (arg3) { 802 if (arg3) {
802 base::JSONWriter::Write(arg3, &json); 803 base::JSONWriter::Write(arg3, &json);
803 params.append(", " + json); 804 params.append(", " + json);
804 } 805 }
805 } 806 }
806 } 807 }
807 base::string16 javascript = 808
808 base::UTF8ToUTF16(function_name + "(" + params + ");"); 809 base::string16 javascript = base::UTF8ToUTF16(
810 function_name + "(" + params + ");");
809 web_contents_->GetMainFrame()->ExecuteJavaScript(javascript); 811 web_contents_->GetMainFrame()->ExecuteJavaScript(javascript);
810 } 812 }
811 813
812 void DevToolsUIBindings::DocumentOnLoadCompletedInMainFrame() { 814 void DevToolsUIBindings::DocumentOnLoadCompletedInMainFrame() {
813 // Call delegate first - it seeds importants bit of information. 815 // Call delegate first - it seeds importants bit of information.
814 delegate_->OnLoadCompleted(); 816 delegate_->OnLoadCompleted();
815 817
816 UpdateTheme(); 818 UpdateTheme();
817 AddDevToolsExtensionsToClient(); 819 AddDevToolsExtensionsToClient();
818 } 820 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/devtools/devtools_frontend_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698