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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 102593002: Convert string16 to base::string16 in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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 "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 render_view_host_delegate_view_(NULL), 341 render_view_host_delegate_view_(NULL),
342 opener_(opener), 342 opener_(opener),
343 #if defined(OS_WIN) && defined(USE_AURA) 343 #if defined(OS_WIN) && defined(USE_AURA)
344 accessible_parent_(NULL), 344 accessible_parent_(NULL),
345 #endif 345 #endif
346 frame_tree_(new Navigator(&controller_, this), this, this, this), 346 frame_tree_(new Navigator(&controller_, this), this, this, this),
347 is_loading_(false), 347 is_loading_(false),
348 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), 348 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING),
349 crashed_error_code_(0), 349 crashed_error_code_(0),
350 waiting_for_response_(false), 350 waiting_for_response_(false),
351 load_state_(net::LOAD_STATE_IDLE, string16()), 351 load_state_(net::LOAD_STATE_IDLE, base::string16()),
352 upload_size_(0), 352 upload_size_(0),
353 upload_position_(0), 353 upload_position_(0),
354 displayed_insecure_content_(false), 354 displayed_insecure_content_(false),
355 capturer_count_(0), 355 capturer_count_(0),
356 should_normally_be_visible_(true), 356 should_normally_be_visible_(true),
357 is_being_destroyed_(false), 357 is_being_destroyed_(false),
358 notify_disconnection_(false), 358 notify_disconnection_(false),
359 dialog_manager_(NULL), 359 dialog_manager_(NULL),
360 is_showing_before_unload_dialog_(false), 360 is_showing_before_unload_dialog_(false),
361 closed_by_user_gesture_(false), 361 closed_by_user_gesture_(false),
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 720
721 #if defined(OS_WIN) && defined(USE_AURA) 721 #if defined(OS_WIN) && defined(USE_AURA)
722 void WebContentsImpl::SetParentNativeViewAccessible( 722 void WebContentsImpl::SetParentNativeViewAccessible(
723 gfx::NativeViewAccessible accessible_parent) { 723 gfx::NativeViewAccessible accessible_parent) {
724 accessible_parent_ = accessible_parent; 724 accessible_parent_ = accessible_parent;
725 if (GetRenderViewHost()) 725 if (GetRenderViewHost())
726 GetRenderViewHostImpl()->SetParentNativeViewAccessible(accessible_parent); 726 GetRenderViewHostImpl()->SetParentNativeViewAccessible(accessible_parent);
727 } 727 }
728 #endif 728 #endif
729 729
730 const string16& WebContentsImpl::GetTitle() const { 730 const base::string16& WebContentsImpl::GetTitle() const {
731 // Transient entries take precedence. They are used for interstitial pages 731 // Transient entries take precedence. They are used for interstitial pages
732 // that are shown on top of existing pages. 732 // that are shown on top of existing pages.
733 NavigationEntry* entry = controller_.GetTransientEntry(); 733 NavigationEntry* entry = controller_.GetTransientEntry();
734 std::string accept_languages = 734 std::string accept_languages =
735 GetContentClient()->browser()->GetAcceptLangs( 735 GetContentClient()->browser()->GetAcceptLangs(
736 GetBrowserContext()); 736 GetBrowserContext());
737 if (entry) { 737 if (entry) {
738 return entry->GetTitleForDisplay(accept_languages); 738 return entry->GetTitleForDisplay(accept_languages);
739 } 739 }
740 WebUI* our_web_ui = GetRenderManager()->pending_web_ui() ? 740 WebUI* our_web_ui = GetRenderManager()->pending_web_ui() ?
741 GetRenderManager()->pending_web_ui() : GetRenderManager()->web_ui(); 741 GetRenderManager()->pending_web_ui() : GetRenderManager()->web_ui();
742 if (our_web_ui) { 742 if (our_web_ui) {
743 // Don't override the title in view source mode. 743 // Don't override the title in view source mode.
744 entry = controller_.GetVisibleEntry(); 744 entry = controller_.GetVisibleEntry();
745 if (!(entry && entry->IsViewSourceMode())) { 745 if (!(entry && entry->IsViewSourceMode())) {
746 // Give the Web UI the chance to override our title. 746 // Give the Web UI the chance to override our title.
747 const string16& title = our_web_ui->GetOverriddenTitle(); 747 const base::string16& title = our_web_ui->GetOverriddenTitle();
748 if (!title.empty()) 748 if (!title.empty())
749 return title; 749 return title;
750 } 750 }
751 } 751 }
752 752
753 // We use the title for the last committed entry rather than a pending 753 // We use the title for the last committed entry rather than a pending
754 // navigation entry. For example, when the user types in a URL, we want to 754 // navigation entry. For example, when the user types in a URL, we want to
755 // keep the old page's title until the new load has committed and we get a new 755 // keep the old page's title until the new load has committed and we get a new
756 // title. 756 // title.
757 entry = controller_.GetLastCommittedEntry(); 757 entry = controller_.GetLastCommittedEntry();
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 } 825 }
826 826
827 bool WebContentsImpl::IsWaitingForResponse() const { 827 bool WebContentsImpl::IsWaitingForResponse() const {
828 return waiting_for_response_; 828 return waiting_for_response_;
829 } 829 }
830 830
831 const net::LoadStateWithParam& WebContentsImpl::GetLoadState() const { 831 const net::LoadStateWithParam& WebContentsImpl::GetLoadState() const {
832 return load_state_; 832 return load_state_;
833 } 833 }
834 834
835 const string16& WebContentsImpl::GetLoadStateHost() const { 835 const base::string16& WebContentsImpl::GetLoadStateHost() const {
836 return load_state_host_; 836 return load_state_host_;
837 } 837 }
838 838
839 uint64 WebContentsImpl::GetUploadSize() const { 839 uint64 WebContentsImpl::GetUploadSize() const {
840 return upload_size_; 840 return upload_size_;
841 } 841 }
842 842
843 uint64 WebContentsImpl::GetUploadPosition() const { 843 uint64 WebContentsImpl::GetUploadPosition() const {
844 return upload_position_; 844 return upload_position_;
845 } 845 }
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
2212 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2212 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2213 DidFinishLoad(frame_id, validated_url, is_main_frame, 2213 DidFinishLoad(frame_id, validated_url, is_main_frame,
2214 message_source_)); 2214 message_source_));
2215 } 2215 }
2216 2216
2217 void WebContentsImpl::OnDidFailLoadWithError( 2217 void WebContentsImpl::OnDidFailLoadWithError(
2218 int64 frame_id, 2218 int64 frame_id,
2219 const GURL& url, 2219 const GURL& url,
2220 bool is_main_frame, 2220 bool is_main_frame,
2221 int error_code, 2221 int error_code,
2222 const string16& error_description) { 2222 const base::string16& error_description) {
2223 GURL validated_url(url); 2223 GURL validated_url(url);
2224 RenderProcessHost* render_process_host = message_source_->GetProcess(); 2224 RenderProcessHost* render_process_host = message_source_->GetProcess();
2225 RenderViewHost::FilterURL(render_process_host, false, &validated_url); 2225 RenderViewHost::FilterURL(render_process_host, false, &validated_url);
2226 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2226 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2227 DidFailLoad(frame_id, validated_url, is_main_frame, 2227 DidFailLoad(frame_id, validated_url, is_main_frame,
2228 error_code, error_description, 2228 error_code, error_description,
2229 message_source_)); 2229 message_source_));
2230 } 2230 }
2231 2231
2232 void WebContentsImpl::OnGoToEntryAtOffset(int offset) { 2232 void WebContentsImpl::OnGoToEntryAtOffset(int offset) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
2273 delegate_->EnumerateDirectory(this, request_id, path); 2273 delegate_->EnumerateDirectory(this, request_id, path);
2274 } 2274 }
2275 2275
2276 void WebContentsImpl::OnJSOutOfMemory() { 2276 void WebContentsImpl::OnJSOutOfMemory() {
2277 if (delegate_) 2277 if (delegate_)
2278 delegate_->JSOutOfMemory(this); 2278 delegate_->JSOutOfMemory(this);
2279 } 2279 }
2280 2280
2281 void WebContentsImpl::OnRegisterProtocolHandler(const std::string& protocol, 2281 void WebContentsImpl::OnRegisterProtocolHandler(const std::string& protocol,
2282 const GURL& url, 2282 const GURL& url,
2283 const string16& title, 2283 const base::string16& title,
2284 bool user_gesture) { 2284 bool user_gesture) {
2285 if (!delegate_) 2285 if (!delegate_)
2286 return; 2286 return;
2287 2287
2288 ChildProcessSecurityPolicyImpl* policy = 2288 ChildProcessSecurityPolicyImpl* policy =
2289 ChildProcessSecurityPolicyImpl::GetInstance(); 2289 ChildProcessSecurityPolicyImpl::GetInstance();
2290 if (policy->IsPseudoScheme(protocol)) 2290 if (policy->IsPseudoScheme(protocol))
2291 return; 2291 return;
2292 2292
2293 delegate_->RegisterProtocolHandler(this, protocol, url, title, user_gesture); 2293 delegate_->RegisterProtocolHandler(this, protocol, url, title, user_gesture);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
2509 2509
2510 // Notifies the RenderWidgetHost instance about the fact that the page is 2510 // Notifies the RenderWidgetHost instance about the fact that the page is
2511 // loading, or done loading. 2511 // loading, or done loading.
2512 void WebContentsImpl::SetIsLoading(RenderViewHost* render_view_host, 2512 void WebContentsImpl::SetIsLoading(RenderViewHost* render_view_host,
2513 bool is_loading, 2513 bool is_loading,
2514 LoadNotificationDetails* details) { 2514 LoadNotificationDetails* details) {
2515 if (is_loading == is_loading_) 2515 if (is_loading == is_loading_)
2516 return; 2516 return;
2517 2517
2518 if (!is_loading) { 2518 if (!is_loading) {
2519 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); 2519 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE,
2520 base::string16());
2520 load_state_host_.clear(); 2521 load_state_host_.clear();
2521 upload_size_ = 0; 2522 upload_size_ = 0;
2522 upload_position_ = 0; 2523 upload_position_ = 0;
2523 } 2524 }
2524 2525
2525 GetRenderManager()->SetIsLoading(is_loading); 2526 GetRenderManager()->SetIsLoading(is_loading);
2526 2527
2527 is_loading_ = is_loading; 2528 is_loading_ = is_loading;
2528 waiting_for_response_ = is_loading; 2529 waiting_for_response_ = is_loading;
2529 2530
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
2611 // the renderer updating next_page_id_). Because of this, we only call this 2612 // the renderer updating next_page_id_). Because of this, we only call this
2612 // from CreateRenderView and allow that to notify the RenderView for us. 2613 // from CreateRenderView and allow that to notify the RenderView for us.
2613 int max_restored_page_id = controller_.GetMaxRestoredPageID(); 2614 int max_restored_page_id = controller_.GetMaxRestoredPageID();
2614 if (max_restored_page_id > 2615 if (max_restored_page_id >
2615 GetMaxPageIDForSiteInstance(rvh->GetSiteInstance())) 2616 GetMaxPageIDForSiteInstance(rvh->GetSiteInstance()))
2616 UpdateMaxPageIDForSiteInstance(rvh->GetSiteInstance(), 2617 UpdateMaxPageIDForSiteInstance(rvh->GetSiteInstance(),
2617 max_restored_page_id); 2618 max_restored_page_id);
2618 } 2619 }
2619 2620
2620 bool WebContentsImpl::UpdateTitleForEntry(NavigationEntryImpl* entry, 2621 bool WebContentsImpl::UpdateTitleForEntry(NavigationEntryImpl* entry,
2621 const string16& title) { 2622 const base::string16& title) {
2622 // For file URLs without a title, use the pathname instead. In the case of a 2623 // For file URLs without a title, use the pathname instead. In the case of a
2623 // synthesized title, we don't want the update to count toward the "one set 2624 // synthesized title, we don't want the update to count toward the "one set
2624 // per page of the title to history." 2625 // per page of the title to history."
2625 string16 final_title; 2626 base::string16 final_title;
2626 bool explicit_set; 2627 bool explicit_set;
2627 if (entry && entry->GetURL().SchemeIsFile() && title.empty()) { 2628 if (entry && entry->GetURL().SchemeIsFile() && title.empty()) {
2628 final_title = UTF8ToUTF16(entry->GetURL().ExtractFileName()); 2629 final_title = UTF8ToUTF16(entry->GetURL().ExtractFileName());
2629 explicit_set = false; // Don't count synthetic titles toward the set limit. 2630 explicit_set = false; // Don't count synthetic titles toward the set limit.
2630 } else { 2631 } else {
2631 TrimWhitespace(title, TRIM_ALL, &final_title); 2632 TrimWhitespace(title, TRIM_ALL, &final_title);
2632 explicit_set = true; 2633 explicit_set = true;
2633 } 2634 }
2634 2635
2635 // If a page is created via window.open and never navigated, 2636 // If a page is created via window.open and never navigated,
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
2968 NavigationEntry* entry = controller_.GetEntryAtIndex(entry_index); 2969 NavigationEntry* entry = controller_.GetEntryAtIndex(entry_index);
2969 2970
2970 if (page_state == entry->GetPageState()) 2971 if (page_state == entry->GetPageState())
2971 return; // Nothing to update. 2972 return; // Nothing to update.
2972 entry->SetPageState(page_state); 2973 entry->SetPageState(page_state);
2973 controller_.NotifyEntryChanged(entry, entry_index); 2974 controller_.NotifyEntryChanged(entry, entry_index);
2974 } 2975 }
2975 2976
2976 void WebContentsImpl::UpdateTitle(RenderViewHost* rvh, 2977 void WebContentsImpl::UpdateTitle(RenderViewHost* rvh,
2977 int32 page_id, 2978 int32 page_id,
2978 const string16& title, 2979 const base::string16& title,
2979 base::i18n::TextDirection title_direction) { 2980 base::i18n::TextDirection title_direction) {
2980 // If we have a title, that's a pretty good indication that we've started 2981 // If we have a title, that's a pretty good indication that we've started
2981 // getting useful data. 2982 // getting useful data.
2982 SetNotWaitingForResponse(); 2983 SetNotWaitingForResponse();
2983 2984
2984 // Try to find the navigation entry, which might not be the current one. 2985 // Try to find the navigation entry, which might not be the current one.
2985 // For example, it might be from a pending RVH for the pending entry. 2986 // For example, it might be from a pending RVH for the pending entry.
2986 NavigationEntryImpl* entry = controller_.GetEntryWithPageID( 2987 NavigationEntryImpl* entry = controller_.GetEntryWithPageID(
2987 rvh->GetSiteInstance(), page_id); 2988 rvh->GetSiteInstance(), page_id);
2988 2989
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
3284 } 3285 }
3285 3286
3286 // In most cases, we receive this from a swapped out RenderViewHost. 3287 // In most cases, we receive this from a swapped out RenderViewHost.
3287 // It is possible to receive it from one that has just been swapped in, 3288 // It is possible to receive it from one that has just been swapped in,
3288 // in which case we might as well deliver the message anyway. 3289 // in which case we might as well deliver the message anyway.
3289 Send(new ViewMsg_PostMessageEvent(GetRoutingID(), new_params)); 3290 Send(new ViewMsg_PostMessageEvent(GetRoutingID(), new_params));
3290 } 3291 }
3291 3292
3292 void WebContentsImpl::RunJavaScriptMessage( 3293 void WebContentsImpl::RunJavaScriptMessage(
3293 RenderViewHost* rvh, 3294 RenderViewHost* rvh,
3294 const string16& message, 3295 const base::string16& message,
3295 const string16& default_prompt, 3296 const base::string16& default_prompt,
3296 const GURL& frame_url, 3297 const GURL& frame_url,
3297 JavaScriptMessageType javascript_message_type, 3298 JavaScriptMessageType javascript_message_type,
3298 IPC::Message* reply_msg, 3299 IPC::Message* reply_msg,
3299 bool* did_suppress_message) { 3300 bool* did_suppress_message) {
3300 // Suppress JavaScript dialogs when requested. Also suppress messages when 3301 // Suppress JavaScript dialogs when requested. Also suppress messages when
3301 // showing an interstitial as it's shown over the previous page and we don't 3302 // showing an interstitial as it's shown over the previous page and we don't
3302 // want the hidden page's dialogs to interfere with the interstitial. 3303 // want the hidden page's dialogs to interfere with the interstitial.
3303 bool suppress_this_message = 3304 bool suppress_this_message =
3304 static_cast<RenderViewHostImpl*>(rvh)->is_swapped_out() || 3305 static_cast<RenderViewHostImpl*>(rvh)->is_swapped_out() ||
3305 ShowingInterstitialPage() || 3306 ShowingInterstitialPage() ||
(...skipping 17 matching lines...) Expand all
3323 rvh, 3324 rvh,
3324 reply_msg), 3325 reply_msg),
3325 &suppress_this_message); 3326 &suppress_this_message);
3326 } 3327 }
3327 3328
3328 *did_suppress_message = suppress_this_message; 3329 *did_suppress_message = suppress_this_message;
3329 3330
3330 if (suppress_this_message) { 3331 if (suppress_this_message) {
3331 // If we are suppressing messages, just reply as if the user immediately 3332 // If we are suppressing messages, just reply as if the user immediately
3332 // pressed "Cancel". 3333 // pressed "Cancel".
3333 OnDialogClosed(rvh, reply_msg, false, string16()); 3334 OnDialogClosed(rvh, reply_msg, false, base::string16());
3334 } 3335 }
3335 3336
3336 // OnDialogClosed (two lines up) may have caused deletion of this object (see 3337 // OnDialogClosed (two lines up) may have caused deletion of this object (see
3337 // http://crbug.com/288961 ). The only safe thing to do here is return. 3338 // http://crbug.com/288961 ). The only safe thing to do here is return.
3338 } 3339 }
3339 3340
3340 void WebContentsImpl::RunBeforeUnloadConfirm(RenderViewHost* rvh, 3341 void WebContentsImpl::RunBeforeUnloadConfirm(RenderViewHost* rvh,
3341 const string16& message, 3342 const base::string16& message,
3342 bool is_reload, 3343 bool is_reload,
3343 IPC::Message* reply_msg) { 3344 IPC::Message* reply_msg) {
3344 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(rvh); 3345 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(rvh);
3345 if (delegate_) 3346 if (delegate_)
3346 delegate_->WillRunBeforeUnloadConfirm(); 3347 delegate_->WillRunBeforeUnloadConfirm();
3347 3348
3348 bool suppress_this_message = 3349 bool suppress_this_message =
3349 rvhi->is_swapped_out() || 3350 rvhi->is_swapped_out() ||
3350 !delegate_ || 3351 !delegate_ ||
3351 delegate_->ShouldSuppressDialogs() || 3352 delegate_->ShouldSuppressDialogs() ||
3352 !delegate_->GetJavaScriptDialogManager(); 3353 !delegate_->GetJavaScriptDialogManager();
3353 if (suppress_this_message) { 3354 if (suppress_this_message) {
3354 // The reply must be sent to the RVH that sent the request. 3355 // The reply must be sent to the RVH that sent the request.
3355 rvhi->JavaScriptDialogClosed(reply_msg, true, string16()); 3356 rvhi->JavaScriptDialogClosed(reply_msg, true, base::string16());
3356 return; 3357 return;
3357 } 3358 }
3358 3359
3359 is_showing_before_unload_dialog_ = true; 3360 is_showing_before_unload_dialog_ = true;
3360 dialog_manager_ = delegate_->GetJavaScriptDialogManager(); 3361 dialog_manager_ = delegate_->GetJavaScriptDialogManager();
3361 dialog_manager_->RunBeforeUnloadDialog( 3362 dialog_manager_->RunBeforeUnloadDialog(
3362 this, message, is_reload, 3363 this, message, is_reload,
3363 base::Bind(&WebContentsImpl::OnDialogClosed, base::Unretained(this), rvh, 3364 base::Bind(&WebContentsImpl::OnDialogClosed, base::Unretained(this), rvh,
3364 reply_msg)); 3365 reply_msg));
3365 } 3366 }
3366 3367
3367 bool WebContentsImpl::AddMessageToConsole(int32 level, 3368 bool WebContentsImpl::AddMessageToConsole(int32 level,
3368 const string16& message, 3369 const base::string16& message,
3369 int32 line_no, 3370 int32 line_no,
3370 const string16& source_id) { 3371 const base::string16& source_id) {
3371 if (!delegate_) 3372 if (!delegate_)
3372 return false; 3373 return false;
3373 return delegate_->AddMessageToConsole(this, level, message, line_no, 3374 return delegate_->AddMessageToConsole(this, level, message, line_no,
3374 source_id); 3375 source_id);
3375 } 3376 }
3376 3377
3377 WebPreferences WebContentsImpl::GetWebkitPrefs() { 3378 WebPreferences WebContentsImpl::GetWebkitPrefs() {
3378 // We want to base the page config off of the actual URL, rather than the 3379 // We want to base the page config off of the actual URL, rather than the
3379 // virtual URL. 3380 // virtual URL.
3380 // TODO(nasko): Investigate how to remove the GetActiveEntry usage here, 3381 // TODO(nasko): Investigate how to remove the GetActiveEntry usage here,
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
3583 // Now that the RenderView has been created, we need to tell it its size. 3584 // Now that the RenderView has been created, we need to tell it its size.
3584 if (rwh_view) 3585 if (rwh_view)
3585 rwh_view->SetSize(GetSizeForNewRenderView()); 3586 rwh_view->SetSize(GetSizeForNewRenderView());
3586 3587
3587 // Make sure we use the correct starting page_id in the new RenderView. 3588 // Make sure we use the correct starting page_id in the new RenderView.
3588 UpdateMaxPageIDIfNecessary(render_view_host); 3589 UpdateMaxPageIDIfNecessary(render_view_host);
3589 int32 max_page_id = 3590 int32 max_page_id =
3590 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance()); 3591 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance());
3591 3592
3592 if (!static_cast<RenderViewHostImpl*>( 3593 if (!static_cast<RenderViewHostImpl*>(
3593 render_view_host)->CreateRenderView(string16(), 3594 render_view_host)->CreateRenderView(base::string16(),
3594 opener_route_id, 3595 opener_route_id,
3595 max_page_id)) { 3596 max_page_id)) {
3596 return false; 3597 return false;
3597 } 3598 }
3598 3599
3599 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) 3600 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
3600 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on 3601 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on
3601 // linux. See crbug.com/83941. 3602 // linux. See crbug.com/83941.
3602 if (rwh_view) { 3603 if (rwh_view) {
3603 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) 3604 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost())
3604 render_widget_host->WasResized(); 3605 render_widget_host->WasResized();
3605 } 3606 }
3606 #endif 3607 #endif
3607 3608
3608 return true; 3609 return true;
3609 } 3610 }
3610 3611
3611 #if defined(OS_ANDROID) 3612 #if defined(OS_ANDROID)
3612 bool WebContentsImpl::CreateRenderViewForInitialEmptyDocument() { 3613 bool WebContentsImpl::CreateRenderViewForInitialEmptyDocument() {
3613 return CreateRenderViewForRenderManager(GetRenderViewHost(), 3614 return CreateRenderViewForRenderManager(GetRenderViewHost(),
3614 MSG_ROUTING_NONE); 3615 MSG_ROUTING_NONE);
3615 } 3616 }
3616 #endif 3617 #endif
3617 3618
3618 void WebContentsImpl::OnDialogClosed(RenderViewHost* rvh, 3619 void WebContentsImpl::OnDialogClosed(RenderViewHost* rvh,
3619 IPC::Message* reply_msg, 3620 IPC::Message* reply_msg,
3620 bool success, 3621 bool success,
3621 const string16& user_input) { 3622 const base::string16& user_input) {
3622 if (is_showing_before_unload_dialog_ && !success) { 3623 if (is_showing_before_unload_dialog_ && !success) {
3623 // If a beforeunload dialog is canceled, we need to stop the throbber from 3624 // If a beforeunload dialog is canceled, we need to stop the throbber from
3624 // spinning, since we forced it to start spinning in Navigate. 3625 // spinning, since we forced it to start spinning in Navigate.
3625 DidStopLoading(rvh); 3626 DidStopLoading(rvh);
3626 controller_.DiscardNonCommittedEntries(); 3627 controller_.DiscardNonCommittedEntries();
3627 3628
3628 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3629 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3629 BeforeUnloadDialogCancelled()); 3630 BeforeUnloadDialogCancelled());
3630 } 3631 }
3631 is_showing_before_unload_dialog_ = false; 3632 is_showing_before_unload_dialog_ = false;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
3700 } 3701 }
3701 3702
3702 void WebContentsImpl::OnFrameRemoved( 3703 void WebContentsImpl::OnFrameRemoved(
3703 RenderViewHostImpl* render_view_host, 3704 RenderViewHostImpl* render_view_host,
3704 int64 frame_id) { 3705 int64 frame_id) {
3705 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 3706 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
3706 FrameDetached(render_view_host, frame_id)); 3707 FrameDetached(render_view_host, frame_id));
3707 } 3708 }
3708 3709
3709 } // namespace content 3710 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/browser/web_contents/web_contents_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698