mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
cefclient: Convert NULL to nullptr (see issue #2861)
This commit is contained in:
@ -50,11 +50,11 @@ void BrowserWindow::OnBrowserClosed(CefRefPtr<CefBrowser> browser) {
|
|||||||
REQUIRE_MAIN_THREAD();
|
REQUIRE_MAIN_THREAD();
|
||||||
if (browser_.get()) {
|
if (browser_.get()) {
|
||||||
DCHECK_EQ(browser->GetIdentifier(), browser_->GetIdentifier());
|
DCHECK_EQ(browser->GetIdentifier(), browser_->GetIdentifier());
|
||||||
browser_ = NULL;
|
browser_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
client_handler_->DetachDelegate();
|
client_handler_->DetachDelegate();
|
||||||
client_handler_ = NULL;
|
client_handler_ = nullptr;
|
||||||
|
|
||||||
// |this| may be deleted.
|
// |this| may be deleted.
|
||||||
delegate_->OnBrowserWindowDestroyed();
|
delegate_->OnBrowserWindowDestroyed();
|
||||||
|
@ -965,10 +965,10 @@ BrowserWindowOsrGtk::BrowserWindowOsrGtk(BrowserWindow::Delegate* delegate,
|
|||||||
painting_popup_(false),
|
painting_popup_(false),
|
||||||
hidden_(false),
|
hidden_(false),
|
||||||
glarea_(NULL),
|
glarea_(NULL),
|
||||||
drag_trigger_event_(NULL),
|
drag_trigger_event_(nullptr),
|
||||||
drag_data_(NULL),
|
drag_data_(nullptr),
|
||||||
drag_operation_(DRAG_OPERATION_NONE),
|
drag_operation_(DRAG_OPERATION_NONE),
|
||||||
drag_context_(NULL),
|
drag_context_(nullptr),
|
||||||
drag_targets_(gtk_target_list_new(NULL, 0)),
|
drag_targets_(gtk_target_list_new(NULL, 0)),
|
||||||
drag_leave_(false),
|
drag_leave_(false),
|
||||||
drag_drop_(false),
|
drag_drop_(false),
|
||||||
@ -1900,13 +1900,13 @@ void BrowserWindowOsrGtk::DragReset() {
|
|||||||
CEF_REQUIRE_UI_THREAD();
|
CEF_REQUIRE_UI_THREAD();
|
||||||
if (drag_trigger_event_) {
|
if (drag_trigger_event_) {
|
||||||
gdk_event_free(drag_trigger_event_);
|
gdk_event_free(drag_trigger_event_);
|
||||||
drag_trigger_event_ = NULL;
|
drag_trigger_event_ = nullptr;
|
||||||
}
|
}
|
||||||
drag_data_ = NULL;
|
drag_data_ = nullptr;
|
||||||
drag_operation_ = DRAG_OPERATION_NONE;
|
drag_operation_ = DRAG_OPERATION_NONE;
|
||||||
if (drag_context_) {
|
if (drag_context_) {
|
||||||
g_object_unref(drag_context_);
|
g_object_unref(drag_context_);
|
||||||
drag_context_ = NULL;
|
drag_context_ = nullptr;
|
||||||
}
|
}
|
||||||
drag_leave_ = false;
|
drag_leave_ = false;
|
||||||
drag_drop_ = false;
|
drag_drop_ = false;
|
||||||
@ -1943,12 +1943,12 @@ void BrowserWindowOsrGtk::DragBegin(GtkWidget* widget,
|
|||||||
size_t image_size = image_binary->GetSize();
|
size_t image_size = image_binary->GetSize();
|
||||||
guint8* image_buffer = (guint8*)malloc(image_size); // must free
|
guint8* image_buffer = (guint8*)malloc(image_size); // must free
|
||||||
image_binary->GetData((void*)image_buffer, image_size, 0);
|
image_binary->GetData((void*)image_buffer, image_size, 0);
|
||||||
GdkPixbufLoader* loader = NULL; // must unref
|
GdkPixbufLoader* loader = nullptr; // must unref
|
||||||
GError* error = NULL; // must free
|
GError* error = nullptr; // must free
|
||||||
GdkPixbuf* pixbuf = NULL; // owned by loader
|
GdkPixbuf* pixbuf = nullptr; // owned by loader
|
||||||
gboolean success = FALSE;
|
gboolean success = FALSE;
|
||||||
loader = gdk_pixbuf_loader_new_with_type("png", &error);
|
loader = gdk_pixbuf_loader_new_with_type("png", &error);
|
||||||
if (error == NULL && loader) {
|
if (error == nullptr && loader) {
|
||||||
success = gdk_pixbuf_loader_write(loader, image_buffer, image_size, NULL);
|
success = gdk_pixbuf_loader_write(loader, image_buffer, image_size, NULL);
|
||||||
if (success) {
|
if (success) {
|
||||||
success = gdk_pixbuf_loader_close(loader, NULL);
|
success = gdk_pixbuf_loader_close(loader, NULL);
|
||||||
|
@ -112,7 +112,7 @@ void BrowserWindowOsrWin::OnBrowserClosed(CefRefPtr<CefBrowser> browser) {
|
|||||||
REQUIRE_MAIN_THREAD();
|
REQUIRE_MAIN_THREAD();
|
||||||
|
|
||||||
// Release the OSR window reference. It will be deleted on the UI thread.
|
// Release the OSR window reference. It will be deleted on the UI thread.
|
||||||
osr_window_ = NULL;
|
osr_window_ = nullptr;
|
||||||
|
|
||||||
BrowserWindow::OnBrowserClosed(browser);
|
BrowserWindow::OnBrowserClosed(browser);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ BytesWriteHandler::BytesWriteHandler(size_t grow)
|
|||||||
: grow_(grow), datasize_(grow), offset_(0) {
|
: grow_(grow), datasize_(grow), offset_(0) {
|
||||||
DCHECK_GT(grow, 0U);
|
DCHECK_GT(grow, 0U);
|
||||||
data_ = malloc(grow);
|
data_ = malloc(grow);
|
||||||
DCHECK(data_ != NULL);
|
DCHECK(data_ != nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
BytesWriteHandler::~BytesWriteHandler() {
|
BytesWriteHandler::~BytesWriteHandler() {
|
||||||
@ -81,7 +81,7 @@ size_t BytesWriteHandler::Grow(size_t size) {
|
|||||||
size_t rv;
|
size_t rv;
|
||||||
size_t s = (size > grow_ ? size : grow_);
|
size_t s = (size > grow_ ? size : grow_);
|
||||||
void* tmp = realloc(data_, datasize_ + s);
|
void* tmp = realloc(data_, datasize_ + s);
|
||||||
DCHECK(tmp != NULL);
|
DCHECK(tmp != nullptr);
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
data_ = tmp;
|
data_ = tmp;
|
||||||
datasize_ += s;
|
datasize_ += s;
|
||||||
|
@ -22,7 +22,7 @@ CefRefPtr<CefPrintHandler> ClientAppBrowser::CreatePrintHandler() {
|
|||||||
#if defined(OS_LINUX)
|
#if defined(OS_LINUX)
|
||||||
return new ClientPrintHandlerGtk();
|
return new ClientPrintHandlerGtk();
|
||||||
#else
|
#else
|
||||||
return NULL;
|
return nullptr;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ void ClientHandler::DetachDelegate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DCHECK(delegate_);
|
DCHECK(delegate_);
|
||||||
delegate_ = NULL;
|
delegate_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClientHandler::OnProcessMessageReceived(
|
bool ClientHandler::OnProcessMessageReceived(
|
||||||
@ -615,7 +615,7 @@ void ClientHandler::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
|
|||||||
delete *(it);
|
delete *(it);
|
||||||
}
|
}
|
||||||
message_handler_set_.clear();
|
message_handler_set_.clear();
|
||||||
message_router_ = NULL;
|
message_router_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
NotifyBrowserClosed(browser);
|
NotifyBrowserClosed(browser);
|
||||||
@ -784,7 +784,7 @@ bool ClientHandler::OnSelectClientCertificate(
|
|||||||
command_line->GetSwitchValue(switches::kSslClientCertificate);
|
command_line->GetSwitchValue(switches::kSslClientCertificate);
|
||||||
|
|
||||||
if (cert_name.empty()) {
|
if (cert_name.empty()) {
|
||||||
callback->Select(NULL);
|
callback->Select(nullptr);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ void ClientHandlerOsr::DetachOsrDelegate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DCHECK(osr_delegate_);
|
DCHECK(osr_delegate_);
|
||||||
osr_delegate_ = NULL;
|
osr_delegate_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientHandlerOsr::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
|
void ClientHandlerOsr::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
|
||||||
|
@ -140,7 +140,7 @@ GtkWindow* GetWindow(CefRefPtr<CefBrowser> browser) {
|
|||||||
LOG(ERROR) << "No GtkWindow for browser";
|
LOG(ERROR) << "No GtkWindow for browser";
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunCallback(base::Callback<void(GtkWindow*)> callback, GtkWindow* window) {
|
void RunCallback(base::Callback<void(GtkWindow*)> callback, GtkWindow* window) {
|
||||||
@ -149,7 +149,7 @@ void RunCallback(base::Callback<void(GtkWindow*)> callback, GtkWindow* window) {
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
ClientDialogHandlerGtk::ClientDialogHandlerGtk() : gtk_dialog_(NULL) {}
|
ClientDialogHandlerGtk::ClientDialogHandlerGtk() : gtk_dialog_(nullptr) {}
|
||||||
|
|
||||||
bool ClientDialogHandlerGtk::OnFileDialog(
|
bool ClientDialogHandlerGtk::OnFileDialog(
|
||||||
CefRefPtr<CefBrowser> browser,
|
CefRefPtr<CefBrowser> browser,
|
||||||
@ -221,8 +221,8 @@ void ClientDialogHandlerGtk::OnResetDialogState(CefRefPtr<CefBrowser> browser) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
gtk_widget_destroy(gtk_dialog_);
|
gtk_widget_destroy(gtk_dialog_);
|
||||||
gtk_dialog_ = NULL;
|
gtk_dialog_ = nullptr;
|
||||||
js_dialog_callback_ = NULL;
|
js_dialog_callback_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientDialogHandlerGtk::OnFileDialogContinue(OnFileDialogParams params,
|
void ClientDialogHandlerGtk::OnFileDialogContinue(OnFileDialogParams params,
|
||||||
@ -331,7 +331,7 @@ void ClientDialogHandlerGtk::OnFileDialogContinue(OnFileDialogParams params,
|
|||||||
GSList* filenames =
|
GSList* filenames =
|
||||||
gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog));
|
gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog));
|
||||||
if (filenames) {
|
if (filenames) {
|
||||||
for (GSList* iter = filenames; iter != NULL;
|
for (GSList* iter = filenames; iter != nullptr;
|
||||||
iter = g_slist_next(iter)) {
|
iter = g_slist_next(iter)) {
|
||||||
std::string path(static_cast<char*>(iter->data));
|
std::string path(static_cast<char*>(iter->data));
|
||||||
g_free(iter->data);
|
g_free(iter->data);
|
||||||
@ -347,7 +347,7 @@ void ClientDialogHandlerGtk::OnFileDialogContinue(OnFileDialogParams params,
|
|||||||
if (success) {
|
if (success) {
|
||||||
GtkFileFilter* selected_filter =
|
GtkFileFilter* selected_filter =
|
||||||
gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(dialog));
|
gtk_file_chooser_get_filter(GTK_FILE_CHOOSER(dialog));
|
||||||
if (selected_filter != NULL) {
|
if (selected_filter != nullptr) {
|
||||||
for (size_t x = 0; x < filters.size(); ++x) {
|
for (size_t x = 0; x < filters.size(); ++x) {
|
||||||
if (filters[x] == selected_filter) {
|
if (filters[x] == selected_filter) {
|
||||||
filter_index = x;
|
filter_index = x;
|
||||||
@ -466,7 +466,7 @@ void ClientDialogHandlerGtk::OnDialogResponse(GtkDialog* dialog,
|
|||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
handler->OnResetDialogState(NULL);
|
handler->OnResetDialogState(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace client
|
} // namespace client
|
||||||
|
@ -75,10 +75,10 @@ class DialogCallback : public CefRunFileDialogCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
router_callback_->Success(response);
|
router_callback_->Success(response);
|
||||||
router_callback_ = NULL;
|
router_callback_ = nullptr;
|
||||||
|
|
||||||
dialog_state_->pending_ = false;
|
dialog_state_->pending_ = false;
|
||||||
dialog_state_ = NULL;
|
dialog_state_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -91,7 +91,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
|||||||
CefRefPtr<CefValue> value = CefParseJSON(string, JSON_PARSER_RFC);
|
CefRefPtr<CefValue> value = CefParseJSON(string, JSON_PARSER_RFC);
|
||||||
if (value.get() && value->GetType() == VTYPE_DICTIONARY)
|
if (value.get() && value->GetType() == VTYPE_DICTIONARY)
|
||||||
return value->GetDictionary();
|
return value->GetDictionary();
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify that |key| exists in |dictionary| and has type |value_type|. Fails
|
// Verify that |key| exists in |dictionary| and has type |value_type|. Fails
|
||||||
|
@ -108,7 +108,7 @@ void ImageCache::LoadImages(const ImageInfoSet& image_info,
|
|||||||
|
|
||||||
if (info.id_ == kEmptyId) {
|
if (info.id_ == kEmptyId) {
|
||||||
// Image intentionally left empty.
|
// Image intentionally left empty.
|
||||||
images.push_back(NULL);
|
images.push_back(nullptr);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ void ImageCache::LoadImages(const ImageInfoSet& image_info,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load the image.
|
// Load the image.
|
||||||
images.push_back(NULL);
|
images.push_back(nullptr);
|
||||||
if (!missing_images)
|
if (!missing_images)
|
||||||
missing_images = true;
|
missing_images = true;
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ CefRefPtr<CefImage> ImageCache::GetCachedImage(const std::string& image_id) {
|
|||||||
if (it != image_map_.end())
|
if (it != image_map_.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
|
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@ -273,7 +273,7 @@ CefRefPtr<CefImage> ImageCache::CreateImage(const std::string& image_id,
|
|||||||
DCHECK(!content.image_);
|
DCHECK(!content.image_);
|
||||||
|
|
||||||
if (content.contents_.empty())
|
if (content.contents_.empty())
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
CefRefPtr<CefImage> image = CefImage::CreateImage();
|
CefRefPtr<CefImage> image = CefImage::CreateImage();
|
||||||
|
|
||||||
@ -285,18 +285,18 @@ CefRefPtr<CefImage> ImageCache::CreateImage(const std::string& image_id,
|
|||||||
rep.contents_.size())) {
|
rep.contents_.size())) {
|
||||||
LOG(ERROR) << "Failed to create image " << image_id << " for PNG@"
|
LOG(ERROR) << "Failed to create image " << image_id << " for PNG@"
|
||||||
<< rep.scale_factor_;
|
<< rep.scale_factor_;
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
} else if (rep.type_ == TYPE_JPEG) {
|
} else if (rep.type_ == TYPE_JPEG) {
|
||||||
if (!image->AddJPEG(rep.scale_factor_, rep.contents_.c_str(),
|
if (!image->AddJPEG(rep.scale_factor_, rep.contents_.c_str(),
|
||||||
rep.contents_.size())) {
|
rep.contents_.size())) {
|
||||||
LOG(ERROR) << "Failed to create image " << image_id << " for JPG@"
|
LOG(ERROR) << "Failed to create image " << image_id << " for JPG@"
|
||||||
<< rep.scale_factor_;
|
<< rep.scale_factor_;
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ namespace client {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
MainContext* g_main_context = NULL;
|
MainContext* g_main_context = nullptr;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ MainContext::MainContext() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MainContext::~MainContext() {
|
MainContext::~MainContext() {
|
||||||
g_main_context = NULL;
|
g_main_context = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace client
|
} // namespace client
|
||||||
|
@ -133,7 +133,7 @@ MainContextImpl::MainContextImpl(CefRefPtr<CefCommandLine> command_line,
|
|||||||
// cef_web_plugin.h for details. It's safe to call this method before
|
// cef_web_plugin.h for details. It's safe to call this method before
|
||||||
// CefInitialize(), and calling it before CefInitialize() is required on
|
// CefInitialize(), and calling it before CefInitialize() is required on
|
||||||
// Linux.
|
// Linux.
|
||||||
CefRegisterWidevineCdm(cdm_path, NULL);
|
CefRegisterWidevineCdm(cdm_path, nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ std::string MainContextImpl::GetDownloadPath(const std::string& file_name) {
|
|||||||
|
|
||||||
std::string MainContextImpl::GetAppWorkingDirectory() {
|
std::string MainContextImpl::GetAppWorkingDirectory() {
|
||||||
char szWorkingDir[256];
|
char szWorkingDir[256];
|
||||||
if (getcwd(szWorkingDir, sizeof(szWorkingDir) - 1) == NULL) {
|
if (getcwd(szWorkingDir, sizeof(szWorkingDir) - 1) == nullptr) {
|
||||||
szWorkingDir[0] = 0;
|
szWorkingDir[0] = 0;
|
||||||
} else {
|
} else {
|
||||||
// Add trailing path separator.
|
// Add trailing path separator.
|
||||||
|
@ -25,7 +25,7 @@ std::string MainContextImpl::GetDownloadPath(const std::string& file_name) {
|
|||||||
|
|
||||||
std::string MainContextImpl::GetAppWorkingDirectory() {
|
std::string MainContextImpl::GetAppWorkingDirectory() {
|
||||||
char szWorkingDir[MAX_PATH + 1];
|
char szWorkingDir[MAX_PATH + 1];
|
||||||
if (_getcwd(szWorkingDir, MAX_PATH) == NULL) {
|
if (_getcwd(szWorkingDir, MAX_PATH) == nullptr) {
|
||||||
szWorkingDir[0] = 0;
|
szWorkingDir[0] = 0;
|
||||||
} else {
|
} else {
|
||||||
// Add trailing path separator.
|
// Add trailing path separator.
|
||||||
|
@ -14,7 +14,7 @@ OsrAXNode* OsrAXTree::GetNode(int nodeId) const {
|
|||||||
if (result != node_map_.end()) {
|
if (result != node_map_.end()) {
|
||||||
return result->second;
|
return result->second;
|
||||||
}
|
}
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OsrAXTree::EraseNode(int nodeId) {
|
void OsrAXTree::EraseNode(int nodeId) {
|
||||||
@ -127,7 +127,7 @@ OsrAXNode* OsrAccessibilityHelper::GetFocusedNode() const {
|
|||||||
return tree->second.GetNode(focused_node_id_);
|
return tree->second.GetNode(focused_node_id_);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
OsrAXNode* OsrAccessibilityHelper::GetTreeRootNode(int treeId) const {
|
OsrAXNode* OsrAccessibilityHelper::GetTreeRootNode(int treeId) const {
|
||||||
@ -136,7 +136,7 @@ OsrAXNode* OsrAccessibilityHelper::GetTreeRootNode(int treeId) const {
|
|||||||
return tree->second.GetNode(tree->second.GetRootNodeId());
|
return tree->second.GetNode(tree->second.GetRootNodeId());
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OsrAccessibilityHelper::UpdateLayout(
|
void OsrAccessibilityHelper::UpdateLayout(
|
||||||
@ -205,7 +205,7 @@ void OsrAccessibilityHelper::UpdateLayout(
|
|||||||
if (update->HasKey("root_id")) {
|
if (update->HasKey("root_id")) {
|
||||||
int nodeId = CastToInt(update->GetValue("root_id"));
|
int nodeId = CastToInt(update->GetValue("root_id"));
|
||||||
OsrAXNode* node = GetNode(treeId, nodeId);
|
OsrAXNode* node = GetNode(treeId, nodeId);
|
||||||
if (node != NULL) {
|
if (node != nullptr) {
|
||||||
auto& tree = accessibility_node_map_[treeId];
|
auto& tree = accessibility_node_map_[treeId];
|
||||||
tree.SetRootNodeId(nodeId);
|
tree.SetRootNodeId(nodeId);
|
||||||
}
|
}
|
||||||
@ -242,7 +242,7 @@ void OsrAccessibilityHelper::DestroyNode(OsrAXNode* node) {
|
|||||||
if (!childNode) {
|
if (!childNode) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
childNode->SetParent(NULL);
|
childNode->SetParent(nullptr);
|
||||||
if (childNode->OsrAXTreeId() == treeId) {
|
if (childNode->OsrAXTreeId() == treeId) {
|
||||||
DestroyNode(childNode);
|
DestroyNode(childNode);
|
||||||
}
|
}
|
||||||
@ -263,7 +263,7 @@ OsrAXNode* OsrAccessibilityHelper::GetNode(int treeId, int nodeId) const {
|
|||||||
return tree->second.GetNode(nodeId);
|
return tree->second.GetNode(nodeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace client
|
} // namespace client
|
||||||
|
@ -18,8 +18,8 @@ OsrAXNode::OsrAXNode(int treeId,
|
|||||||
: tree_id_(treeId),
|
: tree_id_(treeId),
|
||||||
node_id_(nodeId),
|
node_id_(nodeId),
|
||||||
child_tree_id_(-1),
|
child_tree_id_(-1),
|
||||||
platform_accessibility_(NULL),
|
platform_accessibility_(nullptr),
|
||||||
parent_(NULL),
|
parent_(nullptr),
|
||||||
offset_container_id_(-1),
|
offset_container_id_(-1),
|
||||||
accessibility_helper_(helper) {
|
accessibility_helper_(helper) {
|
||||||
UpdateValue(value);
|
UpdateValue(value);
|
||||||
@ -105,7 +105,7 @@ CefWindowHandle OsrAXNode::GetWindowHandle() const {
|
|||||||
CefRefPtr<CefBrowser> OsrAXNode::GetBrowser() const {
|
CefRefPtr<CefBrowser> OsrAXNode::GetBrowser() const {
|
||||||
if (accessibility_helper_)
|
if (accessibility_helper_)
|
||||||
return accessibility_helper_->GetBrowser();
|
return accessibility_helper_->GetBrowser();
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OsrAXNode::SetParent(OsrAXNode* parent) {
|
void OsrAXNode::SetParent(OsrAXNode* parent) {
|
||||||
@ -161,7 +161,7 @@ OsrAXNode* OsrAXNode::ChildAtIndex(int index) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create and return the platform specific OsrAXNode Object
|
// Create and return the platform specific OsrAXNode Object
|
||||||
|
@ -63,7 +63,7 @@ class OsrAXNode {
|
|||||||
CefNativeAccessible* GetNativeAccessibleObject(OsrAXNode* parent);
|
CefNativeAccessible* GetNativeAccessibleObject(OsrAXNode* parent);
|
||||||
|
|
||||||
CefNativeAccessible* GetParentAccessibleObject() const {
|
CefNativeAccessible* GetParentAccessibleObject() const {
|
||||||
return parent_ ? parent_->platform_accessibility_ : NULL;
|
return parent_ ? parent_->platform_accessibility_ : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
OsrAccessibilityHelper* GetAccessibilityHelper() const {
|
OsrAccessibilityHelper* GetAccessibilityHelper() const {
|
||||||
|
@ -218,7 +218,7 @@ struct CefIAccessible : public IAccessible {
|
|||||||
|
|
||||||
// Remove the node reference when OsrAXNode is destroyed, so that
|
// Remove the node reference when OsrAXNode is destroyed, so that
|
||||||
// MSAA clients get CO_E_OBJNOTCONNECTED
|
// MSAA clients get CO_E_OBJNOTCONNECTED
|
||||||
void MarkDestroyed() { node_ = NULL; }
|
void MarkDestroyed() { node_ = nullptr; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~CefIAccessible() {}
|
virtual ~CefIAccessible() {}
|
||||||
@ -242,7 +242,7 @@ STDMETHODIMP CefIAccessible::QueryInterface(REFIID riid, void** ppvObject) {
|
|||||||
else if (riid == IID_IUnknown)
|
else if (riid == IID_IUnknown)
|
||||||
*ppvObject = static_cast<IUnknown*>(this);
|
*ppvObject = static_cast<IUnknown*>(this);
|
||||||
else
|
else
|
||||||
*ppvObject = NULL;
|
*ppvObject = nullptr;
|
||||||
|
|
||||||
if (*ppvObject)
|
if (*ppvObject)
|
||||||
reinterpret_cast<IUnknown*>(*ppvObject)->AddRef();
|
reinterpret_cast<IUnknown*>(*ppvObject)->AddRef();
|
||||||
@ -317,7 +317,7 @@ STDMETHODIMP CefIAccessible::get_accChild(VARIANT varChild,
|
|||||||
int numChilds = node_->GetChildCount();
|
int numChilds = node_->GetChildCount();
|
||||||
// Mark Leaf node if there are no child
|
// Mark Leaf node if there are no child
|
||||||
if (numChilds <= 0) {
|
if (numChilds <= 0) {
|
||||||
*ppdispChild = NULL;
|
*ppdispChild = nullptr;
|
||||||
return S_FALSE;
|
return S_FALSE;
|
||||||
} else {
|
} else {
|
||||||
if (ppdispChild && VALID_CHILDID(varChild)) {
|
if (ppdispChild && VALID_CHILDID(varChild)) {
|
||||||
@ -332,7 +332,7 @@ STDMETHODIMP CefIAccessible::get_accChild(VARIANT varChild,
|
|||||||
|
|
||||||
*ppdispChild = child->GetNativeAccessibleObject(node_);
|
*ppdispChild = child->GetNativeAccessibleObject(node_);
|
||||||
}
|
}
|
||||||
if (*ppdispChild == NULL)
|
if (*ppdispChild == nullptr)
|
||||||
retCode = S_FALSE;
|
retCode = S_FALSE;
|
||||||
else
|
else
|
||||||
(*ppdispChild)->AddRef();
|
(*ppdispChild)->AddRef();
|
||||||
@ -449,9 +449,9 @@ STDMETHODIMP CefIAccessible::get_accFocus(VARIANT* pFocusChild) {
|
|||||||
HRESULT retCode = DATACHECK(node_);
|
HRESULT retCode = DATACHECK(node_);
|
||||||
if (SUCCEEDED(retCode)) {
|
if (SUCCEEDED(retCode)) {
|
||||||
OsrAXNode* focusedNode = node_->GetAccessibilityHelper()->GetFocusedNode();
|
OsrAXNode* focusedNode = node_->GetAccessibilityHelper()->GetFocusedNode();
|
||||||
CefNativeAccessible* nativeObj = NULL;
|
CefNativeAccessible* nativeObj = nullptr;
|
||||||
if (focusedNode)
|
if (focusedNode)
|
||||||
nativeObj = focusedNode->GetNativeAccessibleObject(NULL);
|
nativeObj = focusedNode->GetNativeAccessibleObject(nullptr);
|
||||||
|
|
||||||
if (nativeObj) {
|
if (nativeObj) {
|
||||||
if (nativeObj == this) {
|
if (nativeObj == this) {
|
||||||
@ -663,7 +663,7 @@ void OsrAXNode::Destroy() {
|
|||||||
CefIAccessible* ptr = static_cast<CefIAccessible*>(platform_accessibility_);
|
CefIAccessible* ptr = static_cast<CefIAccessible*>(platform_accessibility_);
|
||||||
if (ptr)
|
if (ptr)
|
||||||
ptr->MarkDestroyed();
|
ptr->MarkDestroyed();
|
||||||
platform_accessibility_ = NULL;
|
platform_accessibility_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create and return NSAccessibility Implementation Object for Window
|
// Create and return NSAccessibility Implementation Object for Window
|
||||||
@ -687,7 +687,7 @@ void OsrAXNode::NotifyAccessibilityEvent(std::string event_type) const {}
|
|||||||
void OsrAXNode::Destroy() {}
|
void OsrAXNode::Destroy() {}
|
||||||
|
|
||||||
CefNativeAccessible* OsrAXNode::GetNativeAccessibleObject(OsrAXNode* parent) {
|
CefNativeAccessible* OsrAXNode::GetNativeAccessibleObject(OsrAXNode* parent) {
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace client
|
} // namespace client
|
||||||
|
@ -277,7 +277,7 @@ bool DragDataToDataObject(CefRefPtr<CefDragData> drag_data,
|
|||||||
|
|
||||||
CefRefPtr<CefDragData> DataObjectToDragData(IDataObject* data_object) {
|
CefRefPtr<CefDragData> DataObjectToDragData(IDataObject* data_object) {
|
||||||
CefRefPtr<CefDragData> drag_data = CefDragData::Create();
|
CefRefPtr<CefDragData> drag_data = CefDragData::Create();
|
||||||
IEnumFORMATETC* enumFormats = NULL;
|
IEnumFORMATETC* enumFormats = nullptr;
|
||||||
HRESULT res = data_object->EnumFormatEtc(DATADIR_GET, &enumFormats);
|
HRESULT res = data_object->EnumFormatEtc(DATADIR_GET, &enumFormats);
|
||||||
if (res != S_OK)
|
if (res != S_OK)
|
||||||
return drag_data;
|
return drag_data;
|
||||||
@ -396,7 +396,7 @@ CefBrowserHost::DragOperationsMask DropTargetWin::StartDragging(
|
|||||||
HRESULT res = DoDragDrop(dataObject, dropSource, effect, &resEffect);
|
HRESULT res = DoDragDrop(dataObject, dropSource, effect, &resEffect);
|
||||||
if (res != DRAGDROP_S_DROP)
|
if (res != DRAGDROP_S_DROP)
|
||||||
resEffect = DROPEFFECT_NONE;
|
resEffect = DROPEFFECT_NONE;
|
||||||
current_drag_data_ = NULL;
|
current_drag_data_ = nullptr;
|
||||||
}
|
}
|
||||||
return DropEffectToDragOperation(resEffect);
|
return DropEffectToDragOperation(resEffect);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace client {
|
|||||||
|
|
||||||
#define DEFAULT_QUERY_INTERFACE(__Class) \
|
#define DEFAULT_QUERY_INTERFACE(__Class) \
|
||||||
HRESULT __stdcall QueryInterface(const IID& iid, void** object) { \
|
HRESULT __stdcall QueryInterface(const IID& iid, void** object) { \
|
||||||
*object = NULL; \
|
*object = nullptr; \
|
||||||
if (IsEqualIID(iid, IID_IUnknown)) { \
|
if (IsEqualIID(iid, IID_IUnknown)) { \
|
||||||
IUnknown* obj = this; \
|
IUnknown* obj = this; \
|
||||||
*object = obj; \
|
*object = obj; \
|
||||||
|
@ -307,7 +307,7 @@ void OsrWindowWin::Create(HWND parent_hwnd, const RECT& rect) {
|
|||||||
SetUserDataPtr(hwnd_, this);
|
SetUserDataPtr(hwnd_, this);
|
||||||
|
|
||||||
#if defined(CEF_USE_ATL)
|
#if defined(CEF_USE_ATL)
|
||||||
accessibility_root_ = NULL;
|
accessibility_root_ = nullptr;
|
||||||
|
|
||||||
// Create/register the drag&drop handler.
|
// Create/register the drag&drop handler.
|
||||||
drop_target_ = DropTargetWin::Create(this, hwnd_);
|
drop_target_ = DropTargetWin::Create(this, hwnd_);
|
||||||
@ -332,7 +332,7 @@ void OsrWindowWin::Destroy() {
|
|||||||
#if defined(CEF_USE_ATL)
|
#if defined(CEF_USE_ATL)
|
||||||
// Revoke/delete the drag&drop handler.
|
// Revoke/delete the drag&drop handler.
|
||||||
RevokeDragDrop(hwnd_);
|
RevokeDragDrop(hwnd_);
|
||||||
drop_target_ = NULL;
|
drop_target_ = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
render_handler_.reset();
|
render_handler_.reset();
|
||||||
@ -807,7 +807,7 @@ void OsrWindowWin::OnPaint() {
|
|||||||
|
|
||||||
bool OsrWindowWin::OnEraseBkgnd() {
|
bool OsrWindowWin::OnEraseBkgnd() {
|
||||||
// Erase the background when the browser does not exist.
|
// Erase the background when the browser does not exist.
|
||||||
return (browser_ == NULL);
|
return (browser_ == nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OsrWindowWin::OnTouchEvent(UINT message, WPARAM wParam, LPARAM lParam) {
|
bool OsrWindowWin::OnTouchEvent(UINT message, WPARAM wParam, LPARAM lParam) {
|
||||||
@ -911,8 +911,8 @@ void OsrWindowWin::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
|
|||||||
// Detach |this| from the ClientHandlerOsr.
|
// Detach |this| from the ClientHandlerOsr.
|
||||||
static_cast<ClientHandlerOsr*>(browser_->GetHost()->GetClient().get())
|
static_cast<ClientHandlerOsr*>(browser_->GetHost()->GetClient().get())
|
||||||
->DetachOsrDelegate();
|
->DetachOsrDelegate();
|
||||||
browser_ = NULL;
|
browser_ = nullptr;
|
||||||
render_handler_->SetBrowser(NULL);
|
render_handler_->SetBrowser(nullptr);
|
||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1092,7 +1092,8 @@ void OsrWindowWin::UpdateAccessibilityTree(CefRefPtr<CefValue> value) {
|
|||||||
// Update |accessibility_root_| because UpdateAccessibilityTree may have
|
// Update |accessibility_root_| because UpdateAccessibilityTree may have
|
||||||
// cleared it.
|
// cleared it.
|
||||||
OsrAXNode* root = accessibility_handler_->GetRootNode();
|
OsrAXNode* root = accessibility_handler_->GetRootNode();
|
||||||
accessibility_root_ = root ? root->GetNativeAccessibleObject(NULL) : NULL;
|
accessibility_root_ =
|
||||||
|
root ? root->GetNativeAccessibleObject(nullptr) : nullptr;
|
||||||
#endif // defined(CEF_USE_ATL)
|
#endif // defined(CEF_USE_ATL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
|||||||
CefRefPtr<CefValue> value = CefParseJSON(string, JSON_PARSER_RFC);
|
CefRefPtr<CefValue> value = CefParseJSON(string, JSON_PARSER_RFC);
|
||||||
if (value.get() && value->GetType() == VTYPE_DICTIONARY)
|
if (value.get() && value->GetType() == VTYPE_DICTIONARY)
|
||||||
return value->GetDictionary();
|
return value->GetDictionary();
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert a dictionary value to a JSON string.
|
// Convert a dictionary value to a JSON string.
|
||||||
|
@ -85,7 +85,7 @@ class StickyPrintSettingGtk {
|
|||||||
|
|
||||||
// Lazily initialize the singleton instance.
|
// Lazily initialize the singleton instance.
|
||||||
StickyPrintSettingGtk* GetLastUsedSettings() {
|
StickyPrintSettingGtk* GetLastUsedSettings() {
|
||||||
static StickyPrintSettingGtk* settings = NULL;
|
static StickyPrintSettingGtk* settings = nullptr;
|
||||||
if (!settings)
|
if (!settings)
|
||||||
settings = new StickyPrintSettingGtk();
|
settings = new StickyPrintSettingGtk();
|
||||||
return settings;
|
return settings;
|
||||||
@ -94,7 +94,7 @@ StickyPrintSettingGtk* GetLastUsedSettings() {
|
|||||||
// Helper class to track GTK printers.
|
// Helper class to track GTK printers.
|
||||||
class GtkPrinterList {
|
class GtkPrinterList {
|
||||||
public:
|
public:
|
||||||
GtkPrinterList() : default_printer_(NULL) {
|
GtkPrinterList() : default_printer_(nullptr) {
|
||||||
gtk_enumerate_printers(SetPrinter, this, NULL, TRUE);
|
gtk_enumerate_printers(SetPrinter, this, NULL, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ class GtkPrinterList {
|
|||||||
// - Querying for non-existant printers like 'Print to PDF'.
|
// - Querying for non-existant printers like 'Print to PDF'.
|
||||||
GtkPrinter* GetPrinterWithName(const std::string& name) {
|
GtkPrinter* GetPrinterWithName(const std::string& name) {
|
||||||
if (name.empty())
|
if (name.empty())
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
for (std::vector<GtkPrinter*>::iterator it = printers_.begin();
|
for (std::vector<GtkPrinter*>::iterator it = printers_.begin();
|
||||||
it < printers_.end(); ++it) {
|
it < printers_.end(); ++it) {
|
||||||
@ -123,7 +123,7 @@ class GtkPrinterList {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -279,7 +279,7 @@ GtkWindow* GetWindow(CefRefPtr<CefBrowser> browser) {
|
|||||||
RootWindow::GetForBrowser(browser->GetIdentifier());
|
RootWindow::GetForBrowser(browser->GetIdentifier());
|
||||||
if (root_window)
|
if (root_window)
|
||||||
return GTK_WINDOW(root_window->GetWindowHandle());
|
return GTK_WINDOW(root_window->GetWindowHandle());
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunCallback(base::Callback<void(GtkWindow*)> callback, GtkWindow* window) {
|
void RunCallback(base::Callback<void(GtkWindow*)> callback, GtkWindow* window) {
|
||||||
@ -304,29 +304,29 @@ void GetWindowAndContinue(CefRefPtr<CefBrowser> browser,
|
|||||||
struct ClientPrintHandlerGtk::PrintHandler {
|
struct ClientPrintHandlerGtk::PrintHandler {
|
||||||
PrintHandler(CefRefPtr<CefBrowser> browser)
|
PrintHandler(CefRefPtr<CefBrowser> browser)
|
||||||
: browser_(browser),
|
: browser_(browser),
|
||||||
dialog_(NULL),
|
dialog_(nullptr),
|
||||||
gtk_settings_(NULL),
|
gtk_settings_(nullptr),
|
||||||
page_setup_(NULL),
|
page_setup_(nullptr),
|
||||||
printer_(NULL) {}
|
printer_(nullptr) {}
|
||||||
|
|
||||||
~PrintHandler() {
|
~PrintHandler() {
|
||||||
ScopedGdkThreadsEnter scoped_gdk_threads;
|
ScopedGdkThreadsEnter scoped_gdk_threads;
|
||||||
|
|
||||||
if (dialog_) {
|
if (dialog_) {
|
||||||
gtk_widget_destroy(dialog_);
|
gtk_widget_destroy(dialog_);
|
||||||
dialog_ = NULL;
|
dialog_ = nullptr;
|
||||||
}
|
}
|
||||||
if (gtk_settings_) {
|
if (gtk_settings_) {
|
||||||
g_object_unref(gtk_settings_);
|
g_object_unref(gtk_settings_);
|
||||||
gtk_settings_ = NULL;
|
gtk_settings_ = nullptr;
|
||||||
}
|
}
|
||||||
if (page_setup_) {
|
if (page_setup_) {
|
||||||
g_object_unref(page_setup_);
|
g_object_unref(page_setup_);
|
||||||
page_setup_ = NULL;
|
page_setup_ = nullptr;
|
||||||
}
|
}
|
||||||
if (printer_) {
|
if (printer_) {
|
||||||
g_object_unref(printer_);
|
g_object_unref(printer_);
|
||||||
printer_ = NULL;
|
printer_ = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +370,7 @@ struct ClientPrintHandlerGtk::PrintHandler {
|
|||||||
color_value.c_str());
|
color_value.c_str());
|
||||||
|
|
||||||
if (settings->GetDuplexMode() != DUPLEX_MODE_UNKNOWN) {
|
if (settings->GetDuplexMode() != DUPLEX_MODE_UNKNOWN) {
|
||||||
const char* cups_duplex_mode = NULL;
|
const char* cups_duplex_mode = nullptr;
|
||||||
switch (settings->GetDuplexMode()) {
|
switch (settings->GetDuplexMode()) {
|
||||||
case DUPLEX_MODE_LONG_EDGE:
|
case DUPLEX_MODE_LONG_EDGE:
|
||||||
cups_duplex_mode = kDuplexNoTumble;
|
cups_duplex_mode = kDuplexNoTumble;
|
||||||
@ -523,17 +523,19 @@ struct ClientPrintHandlerGtk::PrintHandler {
|
|||||||
settings->SetSelectionOnly(print_selection_only);
|
settings->SetSelectionOnly(print_selection_only);
|
||||||
InitPrintSettings(gtk_settings_, page_setup_, settings);
|
InitPrintSettings(gtk_settings_, page_setup_, settings);
|
||||||
dialog_callback_->Continue(settings);
|
dialog_callback_->Continue(settings);
|
||||||
dialog_callback_ = NULL;
|
dialog_callback_ = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case GTK_RESPONSE_DELETE_EVENT: // Fall through.
|
case GTK_RESPONSE_DELETE_EVENT: // Fall through.
|
||||||
case GTK_RESPONSE_CANCEL: {
|
case GTK_RESPONSE_CANCEL: {
|
||||||
dialog_callback_->Cancel();
|
dialog_callback_->Cancel();
|
||||||
dialog_callback_ = NULL;
|
dialog_callback_ = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case GTK_RESPONSE_APPLY:
|
case GTK_RESPONSE_APPLY:
|
||||||
default: { NOTREACHED(); }
|
default: {
|
||||||
|
NOTREACHED();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -543,7 +545,7 @@ struct ClientPrintHandlerGtk::PrintHandler {
|
|||||||
// chance to unwind.
|
// chance to unwind.
|
||||||
CefPostTask(TID_UI, base::Bind(&CefPrintJobCallback::Continue,
|
CefPostTask(TID_UI, base::Bind(&CefPrintJobCallback::Continue,
|
||||||
job_callback_.get()));
|
job_callback_.get()));
|
||||||
job_callback_ = NULL;
|
job_callback_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void OnDialogResponseThunk(GtkDialog* dialog,
|
static void OnDialogResponseThunk(GtkDialog* dialog,
|
||||||
|
@ -234,7 +234,7 @@ CefRefPtr<CefResponseFilter> GetResourceResponseFilter(
|
|||||||
if (MatchesFilterURL(url))
|
if (MatchesFilterURL(url))
|
||||||
return new PassThruResponseFilter();
|
return new PassThruResponseFilter();
|
||||||
|
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace response_filter_test
|
} // namespace response_filter_test
|
||||||
|
@ -17,7 +17,7 @@ RootWindowConfig::RootWindowConfig()
|
|||||||
initially_hidden(false),
|
initially_hidden(false),
|
||||||
url(MainContext::Get()->GetMainURL()) {}
|
url(MainContext::Get()->GetMainURL()) {}
|
||||||
|
|
||||||
RootWindow::RootWindow() : delegate_(NULL) {}
|
RootWindow::RootWindow() : delegate_(nullptr) {}
|
||||||
|
|
||||||
RootWindow::~RootWindow() {}
|
RootWindow::~RootWindow() {}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ void RootWindow::OnExtensionsChanged(const ExtensionSet& extensions) {
|
|||||||
|
|
||||||
ExtensionSet::const_iterator it = extensions.begin();
|
ExtensionSet::const_iterator it = extensions.begin();
|
||||||
for (; it != extensions.end(); ++it) {
|
for (; it != extensions.end(); ++it) {
|
||||||
delegate_->CreateExtensionWindow(*it, CefRect(), NULL, base::Closure(),
|
delegate_->CreateExtensionWindow(*it, CefRect(), nullptr, base::Closure(),
|
||||||
WithWindowlessRendering());
|
WithWindowlessRendering());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ scoped_refptr<RootWindow> RootWindow::Create(bool use_views) {
|
|||||||
return new RootWindowMac();
|
return new RootWindowMac();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace client
|
} // namespace client
|
||||||
|
@ -56,12 +56,12 @@ RootWindowGtk::RootWindowGtk()
|
|||||||
with_extension_(false),
|
with_extension_(false),
|
||||||
is_popup_(false),
|
is_popup_(false),
|
||||||
initialized_(false),
|
initialized_(false),
|
||||||
window_(NULL),
|
window_(nullptr),
|
||||||
back_button_(NULL),
|
back_button_(nullptr),
|
||||||
forward_button_(NULL),
|
forward_button_(nullptr),
|
||||||
reload_button_(NULL),
|
reload_button_(nullptr),
|
||||||
stop_button_(NULL),
|
stop_button_(nullptr),
|
||||||
url_entry_(NULL),
|
url_entry_(nullptr),
|
||||||
toolbar_height_(0),
|
toolbar_height_(0),
|
||||||
menubar_height_(0),
|
menubar_height_(0),
|
||||||
window_destroyed_(false),
|
window_destroyed_(false),
|
||||||
@ -225,7 +225,7 @@ CefRefPtr<CefBrowser> RootWindowGtk::GetBrowser() const {
|
|||||||
|
|
||||||
if (browser_window_)
|
if (browser_window_)
|
||||||
return browser_window_->GetBrowser();
|
return browser_window_->GetBrowser();
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientWindowHandle RootWindowGtk::GetWindowHandle() const {
|
ClientWindowHandle RootWindowGtk::GetWindowHandle() const {
|
||||||
@ -380,7 +380,7 @@ void RootWindowGtk::CreateRootWindow(const CefBrowserSettings& settings,
|
|||||||
|
|
||||||
if (!is_popup_) {
|
if (!is_popup_) {
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
browser_window_->CreateBrowser(parent, browser_bounds_, settings, NULL,
|
browser_window_->CreateBrowser(parent, browser_bounds_, settings, nullptr,
|
||||||
delegate_->GetRequestContext(this));
|
delegate_->GetRequestContext(this));
|
||||||
} else {
|
} else {
|
||||||
// With popups we already have a browser window. Parent the browser window
|
// With popups we already have a browser window. Parent the browser window
|
||||||
|
@ -174,7 +174,7 @@ scoped_refptr<RootWindow> RootWindowManager::CreateRootWindowAsExtension(
|
|||||||
const std::string& extension_url = extension_util::GetExtensionURL(extension);
|
const std::string& extension_url = extension_util::GetExtensionURL(extension);
|
||||||
if (extension_url.empty()) {
|
if (extension_url.empty()) {
|
||||||
NOTREACHED() << "Extension cannot be loaded directly.";
|
NOTREACHED() << "Extension cannot be loaded directly.";
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create an initially hidden browser window that loads the extension URL.
|
// Create an initially hidden browser window that loads the extension URL.
|
||||||
@ -226,7 +226,7 @@ scoped_refptr<RootWindow> RootWindowManager::GetWindowForBrowser(
|
|||||||
if (browser.get() && browser->GetIdentifier() == browser_id)
|
if (browser.get() && browser->GetIdentifier() == browser_id)
|
||||||
return *it;
|
return *it;
|
||||||
}
|
}
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
scoped_refptr<RootWindow> RootWindowManager::GetActiveRootWindow() const {
|
scoped_refptr<RootWindow> RootWindowManager::GetActiveRootWindow() const {
|
||||||
@ -382,10 +382,10 @@ void RootWindowManager::OnRootWindowDestroyed(RootWindow* root_window) {
|
|||||||
root_windows_.erase(it);
|
root_windows_.erase(it);
|
||||||
|
|
||||||
if (root_window == active_root_window_) {
|
if (root_window == active_root_window_) {
|
||||||
active_root_window_ = NULL;
|
active_root_window_ = nullptr;
|
||||||
|
|
||||||
base::AutoLock lock_scope(active_browser_lock_);
|
base::AutoLock lock_scope(active_browser_lock_);
|
||||||
active_browser_ = NULL;
|
active_browser_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (terminate_when_all_windows_closed_ && root_windows_.empty()) {
|
if (terminate_when_all_windows_closed_ && root_windows_.empty()) {
|
||||||
|
@ -251,7 +251,7 @@ void RootWindowViews::OnViewsWindowCreated(CefRefPtr<ViewsWindow> window) {
|
|||||||
|
|
||||||
void RootWindowViews::OnViewsWindowDestroyed(CefRefPtr<ViewsWindow> window) {
|
void RootWindowViews::OnViewsWindowDestroyed(CefRefPtr<ViewsWindow> window) {
|
||||||
CEF_REQUIRE_UI_THREAD();
|
CEF_REQUIRE_UI_THREAD();
|
||||||
window_ = NULL;
|
window_ = nullptr;
|
||||||
|
|
||||||
// Continue on the main thread.
|
// Continue on the main thread.
|
||||||
MAIN_POST_CLOSURE(
|
MAIN_POST_CLOSURE(
|
||||||
@ -333,11 +333,11 @@ void RootWindowViews::OnBrowserClosed(CefRefPtr<CefBrowser> browser) {
|
|||||||
REQUIRE_MAIN_THREAD();
|
REQUIRE_MAIN_THREAD();
|
||||||
if (browser_) {
|
if (browser_) {
|
||||||
DCHECK_EQ(browser->GetIdentifier(), browser_->GetIdentifier());
|
DCHECK_EQ(browser->GetIdentifier(), browser_->GetIdentifier());
|
||||||
browser_ = NULL;
|
browser_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
client_handler_->DetachDelegate();
|
client_handler_->DetachDelegate();
|
||||||
client_handler_ = NULL;
|
client_handler_ = nullptr;
|
||||||
|
|
||||||
browser_destroyed_ = true;
|
browser_destroyed_ = true;
|
||||||
NotifyDestroyedIfDone();
|
NotifyDestroyedIfDone();
|
||||||
|
@ -286,7 +286,7 @@ CefRefPtr<CefBrowser> RootWindowWin::GetBrowser() const {
|
|||||||
|
|
||||||
if (browser_window_)
|
if (browser_window_)
|
||||||
return browser_window_->GetBrowser();
|
return browser_window_->GetBrowser();
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientWindowHandle RootWindowWin::GetWindowHandle() const {
|
ClientWindowHandle RootWindowWin::GetWindowHandle() const {
|
||||||
@ -489,7 +489,7 @@ LRESULT CALLBACK RootWindowWin::RootWndProc(HWND hWnd,
|
|||||||
LPARAM lParam) {
|
LPARAM lParam) {
|
||||||
REQUIRE_MAIN_THREAD();
|
REQUIRE_MAIN_THREAD();
|
||||||
|
|
||||||
RootWindowWin* self = NULL;
|
RootWindowWin* self = nullptr;
|
||||||
if (message != WM_NCCREATE) {
|
if (message != WM_NCCREATE) {
|
||||||
self = GetUserDataPtr<RootWindowWin*>(hWnd);
|
self = GetUserDataPtr<RootWindowWin*>(hWnd);
|
||||||
if (!self)
|
if (!self)
|
||||||
@ -749,7 +749,7 @@ void RootWindowWin::OnDpiChanged(WPARAM wParam, LPARAM lParam) {
|
|||||||
|
|
||||||
bool RootWindowWin::OnEraseBkgnd() {
|
bool RootWindowWin::OnEraseBkgnd() {
|
||||||
// Erase the background when the browser does not exist.
|
// Erase the background when the browser does not exist.
|
||||||
return (GetBrowser() == NULL);
|
return (GetBrowser() == nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RootWindowWin::OnCommand(UINT id) {
|
bool RootWindowWin::OnCommand(UINT id) {
|
||||||
@ -949,7 +949,7 @@ void RootWindowWin::OnCreate(LPCREATESTRUCT lpCreateStruct) {
|
|||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
CefRect cef_rect(rect.left, rect.top, rect.right - rect.left,
|
CefRect cef_rect(rect.left, rect.top, rect.right - rect.left,
|
||||||
rect.bottom - rect.top);
|
rect.bottom - rect.top);
|
||||||
browser_window_->CreateBrowser(hwnd_, cef_rect, browser_settings_, NULL,
|
browser_window_->CreateBrowser(hwnd_, cef_rect, browser_settings_, nullptr,
|
||||||
delegate_->GetRequestContext(this));
|
delegate_->GetRequestContext(this));
|
||||||
} else {
|
} else {
|
||||||
// With popups we already have a browser window. Parent the browser window
|
// With popups we already have a browser window. Parent the browser window
|
||||||
|
@ -39,7 +39,7 @@ class ClientSchemeHandler : public CefResourceHandler {
|
|||||||
bool handled = false;
|
bool handled = false;
|
||||||
|
|
||||||
std::string url = request->GetURL();
|
std::string url = request->GetURL();
|
||||||
if (strstr(url.c_str(), "handler.html") != NULL) {
|
if (strstr(url.c_str(), "handler.html") != nullptr) {
|
||||||
// Build the response html
|
// Build the response html
|
||||||
data_ =
|
data_ =
|
||||||
"<html><head><title>Client Scheme Handler</title></head>"
|
"<html><head><title>Client Scheme Handler</title></head>"
|
||||||
@ -65,7 +65,7 @@ class ClientSchemeHandler : public CefResourceHandler {
|
|||||||
|
|
||||||
// Set the resulting mime type
|
// Set the resulting mime type
|
||||||
mime_type_ = "text/html";
|
mime_type_ = "text/html";
|
||||||
} else if (strstr(url.c_str(), "logo.png") != NULL) {
|
} else if (strstr(url.c_str(), "logo.png") != nullptr) {
|
||||||
// Load the response image
|
// Load the response image
|
||||||
if (LoadBinaryResource("logo.png", data_)) {
|
if (LoadBinaryResource("logo.png", data_)) {
|
||||||
handled = true;
|
handled = true;
|
||||||
|
@ -352,7 +352,7 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
|||||||
CefRefPtr<CefValue> value = CefParseJSON(string, JSON_PARSER_RFC);
|
CefRefPtr<CefValue> value = CefParseJSON(string, JSON_PARSER_RFC);
|
||||||
if (value.get() && value->GetType() == VTYPE_DICTIONARY)
|
if (value.get() && value->GetType() == VTYPE_DICTIONARY)
|
||||||
return value->GetDictionary();
|
return value->GetDictionary();
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify that |key| exists in |dictionary| and has type |value_type|. Fails
|
// Verify that |key| exists in |dictionary| and has type |value_type|. Fails
|
||||||
|
@ -30,7 +30,7 @@ HWND CreateTempWindow() {
|
|||||||
1, 1, NULL, NULL, hInstance, NULL);
|
1, 1, NULL, NULL, hInstance, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
TempWindowWin* g_temp_window = NULL;
|
TempWindowWin* g_temp_window = nullptr;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ TempWindowWin::TempWindowWin() : hwnd_(NULL) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TempWindowWin::~TempWindowWin() {
|
TempWindowWin::~TempWindowWin() {
|
||||||
g_temp_window = NULL;
|
g_temp_window = nullptr;
|
||||||
DCHECK(hwnd_);
|
DCHECK(hwnd_);
|
||||||
DestroyWindow(hwnd_);
|
DestroyWindow(hwnd_);
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ void CloseTempWindow(::Window xwindow) {
|
|||||||
XDestroyWindow(xdisplay, xwindow);
|
XDestroyWindow(xdisplay, xwindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
TempWindowX11* g_temp_window = NULL;
|
TempWindowX11* g_temp_window = nullptr;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ TempWindowX11::TempWindowX11() : xwindow_(kNullWindowHandle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TempWindowX11::~TempWindowX11() {
|
TempWindowX11::~TempWindowX11() {
|
||||||
g_temp_window = NULL;
|
g_temp_window = nullptr;
|
||||||
DCHECK(xwindow_);
|
DCHECK(xwindow_);
|
||||||
|
|
||||||
CloseTempWindow(xwindow_);
|
CloseTempWindow(xwindow_);
|
||||||
|
@ -323,7 +323,7 @@ void BeginTracing() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CefBeginTracing(CefString(), NULL);
|
CefBeginTracing(CefString(), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EndTracing(CefRefPtr<CefBrowser> browser) {
|
void EndTracing(CefRefPtr<CefBrowser> browser) {
|
||||||
@ -364,7 +364,7 @@ void EndTracing(CefRefPtr<CefBrowser> browser) {
|
|||||||
CefEndTracing(file_paths.front(), this);
|
CefEndTracing(file_paths.front(), this);
|
||||||
} else {
|
} else {
|
||||||
// No file selected. Discard the trace data.
|
// No file selected. Discard the trace data.
|
||||||
CefEndTracing(CefString(), NULL);
|
CefEndTracing(CefString(), nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,13 +147,13 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
|||||||
static_cast<RequestClient*>(urlrequest_->GetClient().get())->Detach();
|
static_cast<RequestClient*>(urlrequest_->GetClient().get())->Detach();
|
||||||
|
|
||||||
urlrequest_->Cancel();
|
urlrequest_->Cancel();
|
||||||
urlrequest_ = NULL;
|
urlrequest_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (callback_.get()) {
|
if (callback_.get()) {
|
||||||
// Must always execute |callback_| before deleting it.
|
// Must always execute |callback_| before deleting it.
|
||||||
callback_->Failure(ERR_ABORTED, test_runner::GetErrorString(ERR_ABORTED));
|
callback_->Failure(ERR_ABORTED, test_runner::GetErrorString(ERR_ABORTED));
|
||||||
callback_ = NULL;
|
callback_ = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,8 +166,8 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
|||||||
else
|
else
|
||||||
callback_->Failure(error_code, test_runner::GetErrorString(error_code));
|
callback_->Failure(error_code, test_runner::GetErrorString(error_code));
|
||||||
|
|
||||||
callback_ = NULL;
|
callback_ = nullptr;
|
||||||
urlrequest_ = NULL;
|
urlrequest_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
CefRefPtr<Callback> callback_;
|
CefRefPtr<Callback> callback_;
|
||||||
|
@ -99,7 +99,7 @@ CefRefPtr<CefMenuModel> ViewsMenuBar::CreateMenuModel(const CefString& label,
|
|||||||
CefRefPtr<CefMenuModel> ViewsMenuBar::GetMenuModel(int menu_id) const {
|
CefRefPtr<CefMenuModel> ViewsMenuBar::GetMenuModel(int menu_id) const {
|
||||||
if (HasMenuId(menu_id))
|
if (HasMenuId(menu_id))
|
||||||
return models_[menu_id - id_start_];
|
return models_[menu_id - id_start_];
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewsMenuBar::SetMenuFocusable(bool focusable) {
|
void ViewsMenuBar::SetMenuFocusable(bool focusable) {
|
||||||
@ -141,7 +141,7 @@ bool ViewsMenuBar::OnKeyEvent(const CefKeyEvent& event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ViewsMenuBar::Reset() {
|
void ViewsMenuBar::Reset() {
|
||||||
panel_ = NULL;
|
panel_ = nullptr;
|
||||||
models_.clear();
|
models_.clear();
|
||||||
mnemonics_.clear();
|
mnemonics_.clear();
|
||||||
id_next_ = id_start_;
|
id_next_ = id_start_;
|
||||||
@ -239,7 +239,7 @@ void ViewsMenuBar::EnsureMenuPanel() {
|
|||||||
if (panel_)
|
if (panel_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
panel_ = CefPanel::CreatePanel(NULL);
|
panel_ = CefPanel::CreatePanel(nullptr);
|
||||||
views_style::ApplyTo(panel_);
|
views_style::ApplyTo(panel_);
|
||||||
|
|
||||||
// Use a horizontal box layout.
|
// Use a horizontal box layout.
|
||||||
|
@ -112,11 +112,11 @@ CefRefPtr<ViewsWindow> ViewsWindow::Create(
|
|||||||
DCHECK(delegate);
|
DCHECK(delegate);
|
||||||
|
|
||||||
// Create a new ViewsWindow.
|
// Create a new ViewsWindow.
|
||||||
CefRefPtr<ViewsWindow> views_window = new ViewsWindow(delegate, NULL);
|
CefRefPtr<ViewsWindow> views_window = new ViewsWindow(delegate, nullptr);
|
||||||
|
|
||||||
// Create a new BrowserView.
|
// Create a new BrowserView.
|
||||||
CefRefPtr<CefBrowserView> browser_view = CefBrowserView::CreateBrowserView(
|
CefRefPtr<CefBrowserView> browser_view = CefBrowserView::CreateBrowserView(
|
||||||
client, url, settings, NULL, request_context, views_window);
|
client, url, settings, nullptr, request_context, views_window);
|
||||||
|
|
||||||
// Associate the BrowserView with the ViewsWindow.
|
// Associate the BrowserView with the ViewsWindow.
|
||||||
views_window->SetBrowserView(browser_view);
|
views_window->SetBrowserView(browser_view);
|
||||||
@ -334,7 +334,7 @@ CefRefPtr<CefBrowserViewDelegate> ViewsWindow::GetDelegateForPopupBrowserView(
|
|||||||
DCHECK(popup_delegate && popup_delegate != delegate_);
|
DCHECK(popup_delegate && popup_delegate != delegate_);
|
||||||
|
|
||||||
// Create a new ViewsWindow for the popup BrowserView.
|
// Create a new ViewsWindow for the popup BrowserView.
|
||||||
return new ViewsWindow(popup_delegate, NULL);
|
return new ViewsWindow(popup_delegate, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ViewsWindow::OnPopupBrowserViewCreated(
|
bool ViewsWindow::OnPopupBrowserViewCreated(
|
||||||
@ -525,14 +525,14 @@ void ViewsWindow::OnWindowDestroyed(CefRefPtr<CefWindow> window) {
|
|||||||
|
|
||||||
delegate_->OnViewsWindowDestroyed(this);
|
delegate_->OnViewsWindowDestroyed(this);
|
||||||
|
|
||||||
browser_view_ = NULL;
|
browser_view_ = nullptr;
|
||||||
button_menu_model_ = NULL;
|
button_menu_model_ = nullptr;
|
||||||
if (top_menu_bar_) {
|
if (top_menu_bar_) {
|
||||||
top_menu_bar_->Reset();
|
top_menu_bar_->Reset();
|
||||||
top_menu_bar_ = NULL;
|
top_menu_bar_ = nullptr;
|
||||||
}
|
}
|
||||||
extensions_panel_ = NULL;
|
extensions_panel_ = nullptr;
|
||||||
window_ = NULL;
|
window_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ViewsWindow::CanClose(CefRefPtr<CefWindow> window) {
|
bool ViewsWindow::CanClose(CefRefPtr<CefWindow> window) {
|
||||||
@ -711,8 +711,8 @@ void ViewsWindow::CreateMenuModel() {
|
|||||||
|
|
||||||
if (top_menu_bar_) {
|
if (top_menu_bar_) {
|
||||||
// Add the menus to the top menu bar.
|
// Add the menus to the top menu bar.
|
||||||
AddFileMenuItems(top_menu_bar_->CreateMenuModel("&File", NULL));
|
AddFileMenuItems(top_menu_bar_->CreateMenuModel("&File", nullptr));
|
||||||
AddTestMenuItems(top_menu_bar_->CreateMenuModel("&Tests", NULL));
|
AddTestMenuItems(top_menu_bar_->CreateMenuModel("&Tests", nullptr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -762,7 +762,7 @@ void ViewsWindow::AddControls() {
|
|||||||
menu_button->SetMinimumSize(CefSize(0, 0));
|
menu_button->SetMinimumSize(CefSize(0, 0));
|
||||||
|
|
||||||
// Create the top panel.
|
// Create the top panel.
|
||||||
CefRefPtr<CefPanel> top_panel = CefPanel::CreatePanel(NULL);
|
CefRefPtr<CefPanel> top_panel = CefPanel::CreatePanel(nullptr);
|
||||||
|
|
||||||
// Use a horizontal box layout for |top_panel|.
|
// Use a horizontal box layout for |top_panel|.
|
||||||
CefBoxLayoutSettings top_panel_layout_settings;
|
CefBoxLayoutSettings top_panel_layout_settings;
|
||||||
@ -876,7 +876,7 @@ void ViewsWindow::UpdateExtensionControls() {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!extensions_panel_) {
|
if (!extensions_panel_) {
|
||||||
extensions_panel_ = CefPanel::CreatePanel(NULL);
|
extensions_panel_ = CefPanel::CreatePanel(nullptr);
|
||||||
|
|
||||||
// Use a horizontal box layout for |top_panel|.
|
// Use a horizontal box layout for |top_panel|.
|
||||||
CefBoxLayoutSettings top_panel_layout_settings;
|
CefBoxLayoutSettings top_panel_layout_settings;
|
||||||
@ -946,7 +946,7 @@ void ViewsWindow::OnExtensionWindowClosed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Restore the button state.
|
// Restore the button state.
|
||||||
extension_button_pressed_lock_ = NULL;
|
extension_button_pressed_lock_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace client
|
} // namespace client
|
||||||
|
@ -25,7 +25,7 @@ GtkWindow* GetWindow(CefRefPtr<CefBrowser> browser) {
|
|||||||
LOG(ERROR) << "No GtkWindow for browser";
|
LOG(ERROR) << "No GtkWindow for browser";
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsMaximized(GtkWindow* window) {
|
bool IsMaximized(GtkWindow* window) {
|
||||||
|
@ -79,7 +79,7 @@ int RunMain(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Execute the secondary process, if any.
|
// Execute the secondary process, if any.
|
||||||
int exit_code = CefExecuteProcess(main_args, app, NULL);
|
int exit_code = CefExecuteProcess(main_args, app, nullptr);
|
||||||
if (exit_code >= 0)
|
if (exit_code >= 0)
|
||||||
return exit_code;
|
return exit_code;
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ int RunMain(int argc, char* argv[]) {
|
|||||||
message_loop.reset(new MainMessageLoopStd);
|
message_loop.reset(new MainMessageLoopStd);
|
||||||
|
|
||||||
// Initialize CEF.
|
// Initialize CEF.
|
||||||
context->Initialize(main_args, settings, app, NULL);
|
context->Initialize(main_args, settings, app, nullptr);
|
||||||
|
|
||||||
// The Chromium sandbox requires that there only be a single thread during
|
// The Chromium sandbox requires that there only be a single thread during
|
||||||
// initialization. Therefore initialize GTK after CEF.
|
// initialization. Therefore initialize GTK after CEF.
|
||||||
|
@ -39,7 +39,7 @@ int RunMain(HINSTANCE hInstance, int nCmdShow) {
|
|||||||
|
|
||||||
CefMainArgs main_args(hInstance);
|
CefMainArgs main_args(hInstance);
|
||||||
|
|
||||||
void* sandbox_info = NULL;
|
void* sandbox_info = nullptr;
|
||||||
|
|
||||||
#if defined(CEF_USE_SANDBOX)
|
#if defined(CEF_USE_SANDBOX)
|
||||||
// Manage the life span of the sandbox information object. This is necessary
|
// Manage the life span of the sandbox information object. This is necessary
|
||||||
|
@ -103,7 +103,7 @@ class V8Handler : public CefV8Handler {
|
|||||||
retval = CefV8Value::CreateString("Hello, world!");
|
retval = CefV8Value::CreateString("Hello, world!");
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
retval = CefV8Value::CreateObject(NULL, NULL);
|
retval = CefV8Value::CreateObject(nullptr, nullptr);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
retval = CefV8Value::CreateArray(8);
|
retval = CefV8Value::CreateArray(8);
|
||||||
|
@ -160,7 +160,7 @@ PERF_TEST_FUNC(V8FunctionExecuteWithContext) {
|
|||||||
|
|
||||||
PERF_TEST_FUNC(V8ObjectCreate) {
|
PERF_TEST_FUNC(V8ObjectCreate) {
|
||||||
PERF_ITERATIONS_START()
|
PERF_ITERATIONS_START()
|
||||||
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(NULL, NULL);
|
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(nullptr, nullptr);
|
||||||
PERF_ITERATIONS_END()
|
PERF_ITERATIONS_END()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ PERF_TEST_FUNC(V8ObjectCreateWithAccessor) {
|
|||||||
CefRefPtr<CefV8Accessor> accessor = new Accessor();
|
CefRefPtr<CefV8Accessor> accessor = new Accessor();
|
||||||
|
|
||||||
PERF_ITERATIONS_START()
|
PERF_ITERATIONS_START()
|
||||||
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(accessor, NULL);
|
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(accessor, nullptr);
|
||||||
PERF_ITERATIONS_END()
|
PERF_ITERATIONS_END()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,14 +224,14 @@ PERF_TEST_FUNC(V8ObjectCreateWithInterceptor) {
|
|||||||
CefRefPtr<CefV8Interceptor> interceptor = new Interceptor();
|
CefRefPtr<CefV8Interceptor> interceptor = new Interceptor();
|
||||||
|
|
||||||
PERF_ITERATIONS_START()
|
PERF_ITERATIONS_START()
|
||||||
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(NULL, interceptor);
|
CefRefPtr<CefV8Value> value = CefV8Value::CreateObject(nullptr, interceptor);
|
||||||
PERF_ITERATIONS_END()
|
PERF_ITERATIONS_END()
|
||||||
}
|
}
|
||||||
|
|
||||||
PERF_TEST_FUNC(V8ObjectSetValue) {
|
PERF_TEST_FUNC(V8ObjectSetValue) {
|
||||||
CefString name = "name";
|
CefString name = "name";
|
||||||
CefRefPtr<CefV8Value> val = CefV8Value::CreateBool(true);
|
CefRefPtr<CefV8Value> val = CefV8Value::CreateBool(true);
|
||||||
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(NULL, NULL);
|
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(nullptr, nullptr);
|
||||||
obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE);
|
obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||||
|
|
||||||
PERF_ITERATIONS_START()
|
PERF_ITERATIONS_START()
|
||||||
@ -242,7 +242,7 @@ PERF_TEST_FUNC(V8ObjectSetValue) {
|
|||||||
PERF_TEST_FUNC(V8ObjectGetValue) {
|
PERF_TEST_FUNC(V8ObjectGetValue) {
|
||||||
CefString name = "name";
|
CefString name = "name";
|
||||||
CefRefPtr<CefV8Value> val = CefV8Value::CreateBool(true);
|
CefRefPtr<CefV8Value> val = CefV8Value::CreateBool(true);
|
||||||
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(NULL, NULL);
|
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(nullptr, nullptr);
|
||||||
obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE);
|
obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||||
|
|
||||||
PERF_ITERATIONS_START()
|
PERF_ITERATIONS_START()
|
||||||
@ -275,7 +275,7 @@ PERF_TEST_FUNC(V8ObjectSetValueWithAccessor) {
|
|||||||
|
|
||||||
CefString name = "name";
|
CefString name = "name";
|
||||||
CefRefPtr<CefV8Value> val = CefV8Value::CreateBool(true);
|
CefRefPtr<CefV8Value> val = CefV8Value::CreateBool(true);
|
||||||
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(accessor, NULL);
|
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(accessor, nullptr);
|
||||||
obj->SetValue(name, V8_ACCESS_CONTROL_DEFAULT, V8_PROPERTY_ATTRIBUTE_NONE);
|
obj->SetValue(name, V8_ACCESS_CONTROL_DEFAULT, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||||
obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE);
|
obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ PERF_TEST_FUNC(V8ObjectGetValueWithAccessor) {
|
|||||||
|
|
||||||
CefString name = "name";
|
CefString name = "name";
|
||||||
CefRefPtr<CefV8Value> val = CefV8Value::CreateBool(true);
|
CefRefPtr<CefV8Value> val = CefV8Value::CreateBool(true);
|
||||||
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(accessor, NULL);
|
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(accessor, nullptr);
|
||||||
obj->SetValue(name, V8_ACCESS_CONTROL_DEFAULT, V8_PROPERTY_ATTRIBUTE_NONE);
|
obj->SetValue(name, V8_ACCESS_CONTROL_DEFAULT, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||||
obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE);
|
obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||||
|
|
||||||
|
@ -57,9 +57,9 @@ void ClientAppBrowser::OnContextInitialized() {
|
|||||||
if (!cookieable_schemes_.empty()) {
|
if (!cookieable_schemes_.empty()) {
|
||||||
// Register cookieable schemes with the global cookie manager.
|
// Register cookieable schemes with the global cookie manager.
|
||||||
CefRefPtr<CefCookieManager> manager =
|
CefRefPtr<CefCookieManager> manager =
|
||||||
CefCookieManager::GetGlobalManager(NULL);
|
CefCookieManager::GetGlobalManager(nullptr);
|
||||||
DCHECK(manager.get());
|
DCHECK(manager.get());
|
||||||
manager->SetSupportedSchemes(cookieable_schemes_, true, NULL);
|
manager->SetSupportedSchemes(cookieable_schemes_, true, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
print_handler_ = CreatePrintHandler();
|
print_handler_ = CreatePrintHandler();
|
||||||
|
@ -83,7 +83,7 @@ void GetInternalManifest(const std::string& extension_path,
|
|||||||
if (!LoadBinaryResource(manifest_path.c_str(), manifest_contents) ||
|
if (!LoadBinaryResource(manifest_path.c_str(), manifest_contents) ||
|
||||||
manifest_contents.empty()) {
|
manifest_contents.empty()) {
|
||||||
LOG(ERROR) << "Failed to load manifest from " << manifest_path;
|
LOG(ERROR) << "Failed to load manifest from " << manifest_path;
|
||||||
RunManifestCallback(callback, NULL);
|
RunManifestCallback(callback, nullptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ void GetInternalManifest(const std::string& extension_path,
|
|||||||
error_msg = "Incorrectly formatted dictionary contents.";
|
error_msg = "Incorrectly formatted dictionary contents.";
|
||||||
LOG(ERROR) << "Failed to parse manifest from " << manifest_path << "; "
|
LOG(ERROR) << "Failed to parse manifest from " << manifest_path << "; "
|
||||||
<< error_msg.ToString();
|
<< error_msg.ToString();
|
||||||
RunManifestCallback(callback, NULL);
|
RunManifestCallback(callback, nullptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ void LoadExtension(CefRefPtr<CefRequestContext> request_context,
|
|||||||
extension_path, handler));
|
extension_path, handler));
|
||||||
} else {
|
} else {
|
||||||
// Load the extension from disk.
|
// Load the extension from disk.
|
||||||
request_context->LoadExtension(extension_path, NULL, handler);
|
request_context->LoadExtension(extension_path, nullptr, handler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ namespace client {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
MainMessageLoop* g_main_message_loop = NULL;
|
MainMessageLoop* g_main_message_loop = nullptr;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ MainMessageLoop::MainMessageLoop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MainMessageLoop::~MainMessageLoop() {
|
MainMessageLoop::~MainMessageLoop() {
|
||||||
g_main_message_loop = NULL;
|
g_main_message_loop = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
@ -88,7 +88,7 @@ class MainMessageLoop {
|
|||||||
//
|
//
|
||||||
// base::scoped_refptr<Foo> foo = new Foo();
|
// base::scoped_refptr<Foo> foo = new Foo();
|
||||||
// foo->DoSomething();
|
// foo->DoSomething();
|
||||||
// foo = NULL; // Deletion of |foo| will occur on the main thread.
|
// foo = nullptr; // Deletion of |foo| will occur on the main thread.
|
||||||
//
|
//
|
||||||
struct DeleteOnMainThread {
|
struct DeleteOnMainThread {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -22,7 +22,7 @@ const int32 kTimerDelayPlaceholder = INT_MAX;
|
|||||||
// DoWork().
|
// DoWork().
|
||||||
const int64 kMaxTimerDelay = 1000 / 30; // 30fps
|
const int64 kMaxTimerDelay = 1000 / 30; // 30fps
|
||||||
|
|
||||||
client::MainMessageLoopExternalPump* g_external_message_pump = NULL;
|
client::MainMessageLoopExternalPump* g_external_message_pump = nullptr;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ MainMessageLoopExternalPump::MainMessageLoopExternalPump()
|
|||||||
}
|
}
|
||||||
|
|
||||||
MainMessageLoopExternalPump::~MainMessageLoopExternalPump() {
|
MainMessageLoopExternalPump::~MainMessageLoopExternalPump() {
|
||||||
g_external_message_pump = NULL;
|
g_external_message_pump = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
MainMessageLoopExternalPump* MainMessageLoopExternalPump::Get() {
|
MainMessageLoopExternalPump* MainMessageLoopExternalPump::Get() {
|
||||||
|
@ -50,13 +50,13 @@ bool LoadBinaryResource(const char* resource_name, std::string& resource_data) {
|
|||||||
CefRefPtr<CefStreamReader> GetBinaryResourceReader(const char* resource_name) {
|
CefRefPtr<CefStreamReader> GetBinaryResourceReader(const char* resource_name) {
|
||||||
std::string path;
|
std::string path;
|
||||||
if (!GetResourceDir(path))
|
if (!GetResourceDir(path))
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
path.append("/");
|
path.append("/");
|
||||||
path.append(resource_name);
|
path.append(resource_name);
|
||||||
|
|
||||||
if (!FileExists(path.c_str()))
|
if (!FileExists(path.c_str()))
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
return CefStreamReader::CreateForFile(path);
|
return CefStreamReader::CreateForFile(path);
|
||||||
}
|
}
|
||||||
|
@ -103,18 +103,18 @@ bool LoadBinaryResource(const char* resource_name, std::string& resource_data) {
|
|||||||
CefRefPtr<CefStreamReader> GetBinaryResourceReader(const char* resource_name) {
|
CefRefPtr<CefStreamReader> GetBinaryResourceReader(const char* resource_name) {
|
||||||
int resource_id = GetResourceId(resource_name);
|
int resource_id = GetResourceId(resource_name);
|
||||||
if (resource_id == 0)
|
if (resource_id == 0)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
DWORD dwSize;
|
DWORD dwSize;
|
||||||
LPBYTE pBytes;
|
LPBYTE pBytes;
|
||||||
|
|
||||||
if (LoadBinaryResource(resource_id, dwSize, pBytes)) {
|
if (LoadBinaryResource(resource_id, dwSize, pBytes)) {
|
||||||
return CefStreamReader::CreateForHandler(
|
return CefStreamReader::CreateForHandler(
|
||||||
new CefByteReadHandler(pBytes, dwSize, NULL));
|
new CefByteReadHandler(pBytes, dwSize, nullptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
NOTREACHED(); // The resource should be found.
|
NOTREACHED(); // The resource should be found.
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
CefResourceManager::Provider* CreateBinaryResourceProvider(
|
CefResourceManager::Provider* CreateBinaryResourceProvider(
|
||||||
|
@ -46,7 +46,7 @@ int RunMain(int argc, char* argv[]) {
|
|||||||
app = new ClientAppOther();
|
app = new ClientAppOther();
|
||||||
|
|
||||||
// Execute the secondary process.
|
// Execute the secondary process.
|
||||||
return CefExecuteProcess(main_args, app, NULL);
|
return CefExecuteProcess(main_args, app, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace client
|
} // namespace client
|
||||||
|
@ -34,7 +34,7 @@ class ClientAppRenderer : public ClientApp, public CefRenderProcessHandler {
|
|||||||
|
|
||||||
virtual CefRefPtr<CefLoadHandler> GetLoadHandler(
|
virtual CefRefPtr<CefLoadHandler> GetLoadHandler(
|
||||||
CefRefPtr<ClientAppRenderer> app) {
|
CefRefPtr<ClientAppRenderer> app) {
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnContextCreated(CefRefPtr<ClientAppRenderer> app,
|
virtual void OnContextCreated(CefRefPtr<ClientAppRenderer> app,
|
||||||
|
Reference in New Issue
Block a user