| 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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 is_load_to_different_document_(false), | 410 is_load_to_different_document_(false), |
| 411 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), | 411 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), |
| 412 crashed_error_code_(0), | 412 crashed_error_code_(0), |
| 413 waiting_for_response_(false), | 413 waiting_for_response_(false), |
| 414 load_state_(net::LOAD_STATE_IDLE, base::string16()), | 414 load_state_(net::LOAD_STATE_IDLE, base::string16()), |
| 415 upload_size_(0), | 415 upload_size_(0), |
| 416 upload_position_(0), | 416 upload_position_(0), |
| 417 is_resume_pending_(false), | 417 is_resume_pending_(false), |
| 418 displayed_insecure_content_(false), | 418 displayed_insecure_content_(false), |
| 419 displayed_content_with_cert_errors_(false), | 419 displayed_content_with_cert_errors_(false), |
| 420 displayed_password_field_on_http_(false), |
| 421 displayed_credit_card_field_on_http_(false), |
| 420 has_accessed_initial_document_(false), | 422 has_accessed_initial_document_(false), |
| 421 theme_color_(SK_ColorTRANSPARENT), | 423 theme_color_(SK_ColorTRANSPARENT), |
| 422 last_sent_theme_color_(SK_ColorTRANSPARENT), | 424 last_sent_theme_color_(SK_ColorTRANSPARENT), |
| 423 did_first_visually_non_empty_paint_(false), | 425 did_first_visually_non_empty_paint_(false), |
| 424 capturer_count_(0), | 426 capturer_count_(0), |
| 425 should_normally_be_visible_(true), | 427 should_normally_be_visible_(true), |
| 426 did_first_set_visible_(false), | 428 did_first_set_visible_(false), |
| 427 is_being_destroyed_(false), | 429 is_being_destroyed_(false), |
| 428 notify_disconnection_(false), | 430 notify_disconnection_(false), |
| 429 dialog_manager_(NULL), | 431 dialog_manager_(NULL), |
| (...skipping 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2540 } | 2542 } |
| 2541 | 2543 |
| 2542 bool WebContentsImpl::DisplayedInsecureContent() const { | 2544 bool WebContentsImpl::DisplayedInsecureContent() const { |
| 2543 return displayed_insecure_content_; | 2545 return displayed_insecure_content_; |
| 2544 } | 2546 } |
| 2545 | 2547 |
| 2546 bool WebContentsImpl::DisplayedContentWithCertErrors() const { | 2548 bool WebContentsImpl::DisplayedContentWithCertErrors() const { |
| 2547 return displayed_content_with_cert_errors_; | 2549 return displayed_content_with_cert_errors_; |
| 2548 } | 2550 } |
| 2549 | 2551 |
| 2552 bool WebContentsImpl::DisplayedPasswordFieldOnHttp() const { |
| 2553 return displayed_password_field_on_http_; |
| 2554 } |
| 2555 |
| 2556 bool WebContentsImpl::DisplayedCreditCardFieldOnHttp() const { |
| 2557 return displayed_credit_card_field_on_http_; |
| 2558 } |
| 2559 |
| 2550 WebContents* WebContentsImpl::OpenURL(const OpenURLParams& params) { | 2560 WebContents* WebContentsImpl::OpenURL(const OpenURLParams& params) { |
| 2551 if (!delegate_) | 2561 if (!delegate_) |
| 2552 return NULL; | 2562 return NULL; |
| 2553 | 2563 |
| 2554 WebContents* new_contents = delegate_->OpenURLFromTab(this, params); | 2564 WebContents* new_contents = delegate_->OpenURLFromTab(this, params); |
| 2555 return new_contents; | 2565 return new_contents; |
| 2556 } | 2566 } |
| 2557 | 2567 |
| 2558 bool WebContentsImpl::Send(IPC::Message* message) { | 2568 bool WebContentsImpl::Send(IPC::Message* message) { |
| 2559 if (!GetRenderViewHost()) { | 2569 if (!GetRenderViewHost()) { |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3421 | 3431 |
| 3422 // Reset theme color on navigation to new page. | 3432 // Reset theme color on navigation to new page. |
| 3423 theme_color_ = SK_ColorTRANSPARENT; | 3433 theme_color_ = SK_ColorTRANSPARENT; |
| 3424 } | 3434 } |
| 3425 | 3435 |
| 3426 if (!details.is_in_page) { | 3436 if (!details.is_in_page) { |
| 3427 // Once the main frame is navigated, we're no longer considered to have | 3437 // Once the main frame is navigated, we're no longer considered to have |
| 3428 // displayed insecure content. | 3438 // displayed insecure content. |
| 3429 displayed_insecure_content_ = false; | 3439 displayed_insecure_content_ = false; |
| 3430 displayed_content_with_cert_errors_ = false; | 3440 displayed_content_with_cert_errors_ = false; |
| 3441 displayed_password_field_on_http_ = false; |
| 3442 displayed_credit_card_field_on_http_ = false; |
| 3431 SSLManager::NotifySSLInternalStateChanged( | 3443 SSLManager::NotifySSLInternalStateChanged( |
| 3432 GetController().GetBrowserContext()); | 3444 GetController().GetBrowserContext()); |
| 3433 } | 3445 } |
| 3434 | 3446 |
| 3435 // Notify observers about navigation. | 3447 // Notify observers about navigation. |
| 3436 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3448 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 3437 DidNavigateMainFrame(details, params)); | 3449 DidNavigateMainFrame(details, params)); |
| 3438 | 3450 |
| 3439 if (delegate_) | 3451 if (delegate_) |
| 3440 delegate_->DidNavigateMainFramePostCommit(this); | 3452 delegate_->DidNavigateMainFramePostCommit(this); |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3852 } | 3864 } |
| 3853 | 3865 |
| 3854 void WebContentsImpl::SuspendMediaSession() { | 3866 void WebContentsImpl::SuspendMediaSession() { |
| 3855 MediaSession::Get(this)->Suspend(MediaSession::SuspendType::UI); | 3867 MediaSession::Get(this)->Suspend(MediaSession::SuspendType::UI); |
| 3856 } | 3868 } |
| 3857 | 3869 |
| 3858 void WebContentsImpl::StopMediaSession() { | 3870 void WebContentsImpl::StopMediaSession() { |
| 3859 MediaSession::Get(this)->Stop(MediaSession::SuspendType::UI); | 3871 MediaSession::Get(this)->Stop(MediaSession::SuspendType::UI); |
| 3860 } | 3872 } |
| 3861 | 3873 |
| 3874 void WebContentsImpl::OnPasswordInputShownOnHttp() { |
| 3875 displayed_password_field_on_http_ = true; |
| 3876 SSLManager::NotifySSLInternalStateChanged( |
| 3877 GetController().GetBrowserContext()); |
| 3878 } |
| 3879 |
| 3880 void WebContentsImpl::OnCreditCardInputShownOnHttp() { |
| 3881 displayed_credit_card_field_on_http_ = true; |
| 3882 SSLManager::NotifySSLInternalStateChanged( |
| 3883 GetController().GetBrowserContext()); |
| 3884 } |
| 3885 |
| 3862 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() { | 3886 void WebContentsImpl::OnFirstVisuallyNonEmptyPaint() { |
| 3863 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3887 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 3864 DidFirstVisuallyNonEmptyPaint()); | 3888 DidFirstVisuallyNonEmptyPaint()); |
| 3865 | 3889 |
| 3866 did_first_visually_non_empty_paint_ = true; | 3890 did_first_visually_non_empty_paint_ = true; |
| 3867 | 3891 |
| 3868 if (theme_color_ != last_sent_theme_color_) { | 3892 if (theme_color_ != last_sent_theme_color_) { |
| 3869 // Theme color should have updated by now if there was one. | 3893 // Theme color should have updated by now if there was one. |
| 3870 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3894 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 3871 DidChangeThemeColor(theme_color_)); | 3895 DidChangeThemeColor(theme_color_)); |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5260 dialog_manager_ = dialog_manager; | 5284 dialog_manager_ = dialog_manager; |
| 5261 } | 5285 } |
| 5262 | 5286 |
| 5263 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { | 5287 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { |
| 5264 auto it = binding_sets_.find(interface_name); | 5288 auto it = binding_sets_.find(interface_name); |
| 5265 if (it != binding_sets_.end()) | 5289 if (it != binding_sets_.end()) |
| 5266 binding_sets_.erase(it); | 5290 binding_sets_.erase(it); |
| 5267 } | 5291 } |
| 5268 | 5292 |
| 5269 } // namespace content | 5293 } // namespace content |
| OLD | NEW |