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

Side by Side Diff: chrome/renderer/render_view.cc

Issue 307020: Changed active URL handling in RenderView::OnMessageReceived and RenderView::... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 371 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
372 if (command_line.HasSwitch(switches::kDomAutomationController)) 372 if (command_line.HasSwitch(switches::kDomAutomationController))
373 enabled_bindings_ |= BindingsPolicy::DOM_AUTOMATION; 373 enabled_bindings_ |= BindingsPolicy::DOM_AUTOMATION;
374 374
375 audio_message_filter_ = new AudioMessageFilter(routing_id_); 375 audio_message_filter_ = new AudioMessageFilter(routing_id_);
376 render_thread_->AddFilter(audio_message_filter_); 376 render_thread_->AddFilter(audio_message_filter_);
377 } 377 }
378 378
379 void RenderView::OnMessageReceived(const IPC::Message& message) { 379 void RenderView::OnMessageReceived(const IPC::Message& message) {
380 WebFrame* main_frame = webview() ? webview()->mainFrame() : NULL; 380 WebFrame* main_frame = webview() ? webview()->mainFrame() : NULL;
381 child_process_logging::ScopedActiveURLSetter url_setter( 381 if (main_frame)
382 main_frame ? main_frame->url() : WebURL()); 382 child_process_logging::SetActiveURL(main_frame->url());
383 383
384 // If this is developer tools renderer intercept tools messages first. 384 // If this is developer tools renderer intercept tools messages first.
385 if (devtools_client_.get() && devtools_client_->OnMessageReceived(message)) 385 if (devtools_client_.get() && devtools_client_->OnMessageReceived(message))
386 return; 386 return;
387 if (devtools_agent_.get() && devtools_agent_->OnMessageReceived(message)) 387 if (devtools_agent_.get() && devtools_agent_->OnMessageReceived(message))
388 return; 388 return;
389 if (notification_provider_->OnMessageReceived(message)) 389 if (notification_provider_->OnMessageReceived(message))
390 return; 390 return;
391 391
392 IPC_BEGIN_MESSAGE_MAP(RenderView, message) 392 IPC_BEGIN_MESSAGE_MAP(RenderView, message)
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 return static_cast<double>(color_count) / pixel_count; 708 return static_cast<double>(color_count) / pixel_count;
709 } 709 }
710 710
711 void RenderView::OnNavigate(const ViewMsg_Navigate_Params& params) { 711 void RenderView::OnNavigate(const ViewMsg_Navigate_Params& params) {
712 if (!webview()) 712 if (!webview())
713 return; 713 return;
714 714
715 if (devtools_agent_.get()) 715 if (devtools_agent_.get())
716 devtools_agent_->OnNavigate(); 716 devtools_agent_->OnNavigate();
717 717
718 child_process_logging::ScopedActiveURLSetter url_setter(params.url); 718 child_process_logging::SetActiveURL(params.url);
719 719
720 AboutHandler::MaybeHandle(params.url); 720 AboutHandler::MaybeHandle(params.url);
721 721
722 bool is_reload = params.reload; 722 bool is_reload = params.reload;
723 723
724 WebFrame* main_frame = webview()->mainFrame(); 724 WebFrame* main_frame = webview()->mainFrame();
725 if (is_reload && main_frame->currentHistoryItem().isNull()) { 725 if (is_reload && main_frame->currentHistoryItem().isNull()) {
726 // We cannot reload if we do not have any history state. This happens, for 726 // We cannot reload if we do not have any history state. This happens, for
727 // example, when recovering from a crash. Our workaround here is a bit of 727 // example, when recovering from a crash. Our workaround here is a bit of
728 // a hack since it means that reload after a crashed tab does not cause an 728 // a hack since it means that reload after a crashed tab does not cause an
(...skipping 2907 matching lines...) Expand 10 before | Expand all | Expand 10 after
3636 new PluginMsg_SignalModalDialogEvent(host_window_)); 3636 new PluginMsg_SignalModalDialogEvent(host_window_));
3637 3637
3638 message->EnableMessagePumping(); // Runs a nested message loop. 3638 message->EnableMessagePumping(); // Runs a nested message loop.
3639 bool rv = Send(message); 3639 bool rv = Send(message);
3640 3640
3641 PluginChannelHost::Broadcast( 3641 PluginChannelHost::Broadcast(
3642 new PluginMsg_ResetModalDialogEvent(host_window_)); 3642 new PluginMsg_ResetModalDialogEvent(host_window_));
3643 3643
3644 return rv; 3644 return rv;
3645 } 3645 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698