OLD | NEW |
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 "content/renderer/devtools/devtools_agent.h" | 5 #include "content/renderer/devtools/devtools_agent.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 case CONSOLE_MESSAGE_LEVEL_ERROR: | 344 case CONSOLE_MESSAGE_LEVEL_ERROR: |
345 target_level = WebConsoleMessage::LevelError; | 345 target_level = WebConsoleMessage::LevelError; |
346 break; | 346 break; |
347 } | 347 } |
348 main_frame->addMessageToConsole( | 348 main_frame->addMessageToConsole( |
349 WebConsoleMessage(target_level, WebString::fromUTF8(message))); | 349 WebConsoleMessage(target_level, WebString::fromUTF8(message))); |
350 } | 350 } |
351 | 351 |
352 void DevToolsAgent::ContinueProgram() { | 352 void DevToolsAgent::ContinueProgram() { |
353 WebDevToolsAgent* web_agent = GetWebAgent(); | 353 WebDevToolsAgent* web_agent = GetWebAgent(); |
354 // TODO(pfeldman): rename didNavigate to continueProgram upstream. | |
355 // That is in fact the purpose of the signal. | |
356 if (web_agent) | 354 if (web_agent) |
357 web_agent->didNavigate(); | 355 web_agent->continueProgram(); |
358 } | 356 } |
359 | 357 |
360 void DevToolsAgent::OnSetupDevToolsClient() { | 358 void DevToolsAgent::OnSetupDevToolsClient() { |
361 // We only want to register once per render view. | 359 // We only want to register once per render view. |
362 if (is_devtools_client_) | 360 if (is_devtools_client_) |
363 return; | 361 return; |
364 is_devtools_client_ = true; | 362 is_devtools_client_ = true; |
365 new DevToolsClient(static_cast<RenderViewImpl*>(render_view())); | 363 new DevToolsClient(static_cast<RenderViewImpl*>(render_view())); |
366 } | 364 } |
367 | 365 |
368 WebDevToolsAgent* DevToolsAgent::GetWebAgent() { | 366 WebDevToolsAgent* DevToolsAgent::GetWebAgent() { |
369 WebView* web_view = render_view()->GetWebView(); | 367 WebView* web_view = render_view()->GetWebView(); |
370 if (!web_view) | 368 if (!web_view) |
371 return NULL; | 369 return NULL; |
372 return web_view->devToolsAgent(); | 370 return web_view->devToolsAgent(); |
373 } | 371 } |
374 | 372 |
375 bool DevToolsAgent::IsAttached() { | 373 bool DevToolsAgent::IsAttached() { |
376 return is_attached_; | 374 return is_attached_; |
377 } | 375 } |
378 | 376 |
379 } // namespace content | 377 } // namespace content |
OLD | NEW |