2014-11-24 20:23:26 +01:00
|
|
|
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "libcef/browser/navigation_entry_impl.h"
|
|
|
|
|
2016-09-02 12:01:33 +02:00
|
|
|
#include "libcef/browser/ssl_status_impl.h"
|
2014-11-24 20:23:26 +01:00
|
|
|
#include "libcef/common/time_util.h"
|
|
|
|
|
|
|
|
#include "content/public/browser/navigation_entry.h"
|
|
|
|
#include "url/gurl.h"
|
|
|
|
|
|
|
|
CefNavigationEntryImpl::CefNavigationEntryImpl(content::NavigationEntry* value)
|
2017-05-17 11:29:28 +02:00
|
|
|
: CefValueBase<CefNavigationEntry, content::NavigationEntry>(
|
|
|
|
value,
|
2020-01-15 14:36:24 +01:00
|
|
|
nullptr,
|
2017-05-17 11:29:28 +02:00
|
|
|
kOwnerNoDelete,
|
2019-02-01 17:42:40 +01:00
|
|
|
false,
|
2017-05-17 11:29:28 +02:00
|
|
|
new CefValueControllerNonThreadSafe()) {
|
2014-11-24 20:23:26 +01:00
|
|
|
// Indicate that this object owns the controller.
|
|
|
|
SetOwnsController();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefNavigationEntryImpl::IsValid() {
|
|
|
|
return !detached();
|
|
|
|
}
|
|
|
|
|
|
|
|
CefString CefNavigationEntryImpl::GetURL() {
|
|
|
|
CEF_VALUE_VERIFY_RETURN(false, CefString());
|
2019-02-01 17:42:40 +01:00
|
|
|
return mutable_value()->GetURL().spec();
|
2014-11-24 20:23:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
CefString CefNavigationEntryImpl::GetDisplayURL() {
|
|
|
|
CEF_VALUE_VERIFY_RETURN(false, CefString());
|
2019-02-01 17:42:40 +01:00
|
|
|
return mutable_value()->GetVirtualURL().spec();
|
2014-11-24 20:23:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
CefString CefNavigationEntryImpl::GetOriginalURL() {
|
|
|
|
CEF_VALUE_VERIFY_RETURN(false, CefString());
|
2019-02-01 17:42:40 +01:00
|
|
|
return mutable_value()->GetUserTypedURL().spec();
|
2014-11-24 20:23:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
CefString CefNavigationEntryImpl::GetTitle() {
|
|
|
|
CEF_VALUE_VERIFY_RETURN(false, CefString());
|
2019-02-01 17:42:40 +01:00
|
|
|
return mutable_value()->GetTitle();
|
2014-11-24 20:23:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
CefNavigationEntry::TransitionType CefNavigationEntryImpl::GetTransitionType() {
|
|
|
|
CEF_VALUE_VERIFY_RETURN(false, TT_EXPLICIT);
|
2019-02-01 17:42:40 +01:00
|
|
|
return static_cast<TransitionType>(mutable_value()->GetTransitionType());
|
2014-11-24 20:23:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CefNavigationEntryImpl::HasPostData() {
|
|
|
|
CEF_VALUE_VERIFY_RETURN(false, false);
|
2019-02-01 17:42:40 +01:00
|
|
|
return mutable_value()->GetHasPostData();
|
2014-11-24 20:23:26 +01:00
|
|
|
}
|
|
|
|
|
2022-05-31 22:28:43 +02:00
|
|
|
CefBaseTime CefNavigationEntryImpl::GetCompletionTime() {
|
|
|
|
CEF_VALUE_VERIFY_RETURN(false, CefBaseTime());
|
|
|
|
return mutable_value()->GetTimestamp();
|
2014-11-24 20:23:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int CefNavigationEntryImpl::GetHttpStatusCode() {
|
|
|
|
CEF_VALUE_VERIFY_RETURN(false, 0);
|
2019-02-01 17:42:40 +01:00
|
|
|
return mutable_value()->GetHttpStatusCode();
|
2014-11-24 20:23:26 +01:00
|
|
|
}
|
2016-09-02 12:01:33 +02:00
|
|
|
|
|
|
|
CefRefPtr<CefSSLStatus> CefNavigationEntryImpl::GetSSLStatus() {
|
|
|
|
CEF_VALUE_VERIFY_RETURN(false, nullptr);
|
2019-02-01 17:42:40 +01:00
|
|
|
return new CefSSLStatusImpl(mutable_value()->GetSSL());
|
2016-09-02 12:01:33 +02:00
|
|
|
}
|