safer casts, clearer if-else chain
This commit is contained in:
parent
c9e948dc58
commit
9f9aeac59f
1 changed files with 5 additions and 6 deletions
|
@ -31,7 +31,7 @@ static void dump_one(GtkWidget *wat, int indent) {
|
||||||
gtk_widget_get_allocation(wat, &alloc);
|
gtk_widget_get_allocation(wat, &alloc);
|
||||||
fprintf(stderr, "%*s[%p] %s @%d,%d %dx%d",
|
fprintf(stderr, "%*s[%p] %s @%d,%d %dx%d",
|
||||||
indent, "", wat,
|
indent, "", wat,
|
||||||
g_type_name_from_instance(reinterpret_cast<GTypeInstance*>(wat)),
|
g_type_name_from_instance(static_cast<GTypeInstance*>(wat)),
|
||||||
alloc.x, alloc.y, alloc.width, alloc.height);
|
alloc.x, alloc.y, alloc.width, alloc.height);
|
||||||
if (GTK_IS_WINDOW(wat)) {
|
if (GTK_IS_WINDOW(wat)) {
|
||||||
fprintf(stderr, " - \"%s\"", gtk_window_get_title(GTK_WINDOW(wat)));
|
fprintf(stderr, " - \"%s\"", gtk_window_get_title(GTK_WINDOW(wat)));
|
||||||
|
@ -106,7 +106,7 @@ void InspectableWebContentsViewLinux::ShowDevTools() {
|
||||||
DLOG(INFO) << base::StringPrintf(
|
DLOG(INFO) << base::StringPrintf(
|
||||||
"InspectableWebContentsViewLinux::ShowDevTools - " \
|
"InspectableWebContentsViewLinux::ShowDevTools - " \
|
||||||
"parent=%s@%p window=%p dockside=\"%s\"",
|
"parent=%s@%p window=%p dockside=\"%s\"",
|
||||||
g_type_name_from_instance(reinterpret_cast<GTypeInstance*>(parent)),
|
g_type_name_from_instance(static_cast<GTypeInstance*>(parent)),
|
||||||
parent,
|
parent,
|
||||||
devtools_window_,
|
devtools_window_,
|
||||||
dockside_.c_str());
|
dockside_.c_str());
|
||||||
|
@ -132,15 +132,14 @@ void InspectableWebContentsViewLinux::CloseDevTools() {
|
||||||
DLOG(INFO) << base::StringPrintf(
|
DLOG(INFO) << base::StringPrintf(
|
||||||
"InspectableWebContentsViewLinux::CloseDevTools - " \
|
"InspectableWebContentsViewLinux::CloseDevTools - " \
|
||||||
"parent=%s@%p window=%p dockside=\"%s\"",
|
"parent=%s@%p window=%p dockside=\"%s\"",
|
||||||
g_type_name_from_instance(reinterpret_cast<GTypeInstance*>(parent)),
|
g_type_name_from_instance(static_cast<GTypeInstance*>(parent)),
|
||||||
parent,
|
parent,
|
||||||
devtools_window_,
|
devtools_window_,
|
||||||
dockside_.c_str());
|
dockside_.c_str());
|
||||||
|
|
||||||
if (!parent)
|
if (!parent) {
|
||||||
return; // Not visible -> nothing to do
|
return; // Not visible -> nothing to do
|
||||||
|
} else if (GTK_IS_PANED(parent)) {
|
||||||
if (GTK_IS_PANED(parent)) {
|
|
||||||
GtkWidget *browser = GetBrowserWindow();
|
GtkWidget *browser = GetBrowserWindow();
|
||||||
GtkWidget *view = GetNativeView();
|
GtkWidget *view = GetNativeView();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue