Fix building on Linux
This commit is contained in:
parent
97fd383c53
commit
b3d60bfb3a
10 changed files with 28 additions and 24 deletions
|
@ -453,8 +453,8 @@ int ImportIntoCertStore(
|
||||||
|
|
||||||
if (!cert_path.empty()) {
|
if (!cert_path.empty()) {
|
||||||
if (base::ReadFileToString(base::FilePath(cert_path), &file_data)) {
|
if (base::ReadFileToString(base::FilePath(cert_path), &file_data)) {
|
||||||
auto module = model->cert_db()->GetPublicModule();
|
auto module = model->cert_db()->GetPrivateSlot();
|
||||||
rv = model->ImportFromPKCS12(module,
|
rv = model->ImportFromPKCS12(module.get(),
|
||||||
file_data,
|
file_data,
|
||||||
password,
|
password,
|
||||||
true,
|
true,
|
||||||
|
|
|
@ -86,7 +86,7 @@ bool IsAltKey(const content::NativeWebKeyboardEvent& event) {
|
||||||
|
|
||||||
bool IsAltModifier(const content::NativeWebKeyboardEvent& event) {
|
bool IsAltModifier(const content::NativeWebKeyboardEvent& event) {
|
||||||
typedef content::NativeWebKeyboardEvent::Modifiers Modifiers;
|
typedef content::NativeWebKeyboardEvent::Modifiers Modifiers;
|
||||||
int modifiers = event.modifiers;
|
int modifiers = event.modifiers();
|
||||||
modifiers &= ~Modifiers::NumLockOn;
|
modifiers &= ~Modifiers::NumLockOn;
|
||||||
modifiers &= ~Modifiers::CapsLockOn;
|
modifiers &= ~Modifiers::CapsLockOn;
|
||||||
return (modifiers == Modifiers::AltKey) ||
|
return (modifiers == Modifiers::AltKey) ||
|
||||||
|
@ -767,13 +767,14 @@ void NativeWindowViews::SetBackgroundColor(const std::string& color_name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowViews::SetHasShadow(bool has_shadow) {
|
void NativeWindowViews::SetHasShadow(bool has_shadow) {
|
||||||
wm::SetShadowType(
|
wm::SetShadowElevation(
|
||||||
GetNativeWindow(),
|
GetNativeWindow(),
|
||||||
has_shadow ? wm::SHADOW_TYPE_RECTANGULAR : wm::SHADOW_TYPE_NONE);
|
has_shadow ? wm::ShadowElevation::MEDIUM : wm::ShadowElevation::NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NativeWindowViews::HasShadow() {
|
bool NativeWindowViews::HasShadow() {
|
||||||
return wm::GetShadowType(GetNativeWindow()) != wm::SHADOW_TYPE_NONE;
|
return GetNativeWindow()->GetProperty(wm::kShadowElevationKey)
|
||||||
|
!= wm::ShadowElevation::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowViews::SetIgnoreMouseEvents(bool ignore) {
|
void NativeWindowViews::SetIgnoreMouseEvents(bool ignore) {
|
||||||
|
@ -1234,10 +1235,10 @@ void NativeWindowViews::HandleKeyboardEvent(
|
||||||
// Show accelerator when "Alt" is pressed.
|
// Show accelerator when "Alt" is pressed.
|
||||||
if (menu_bar_visible_ && IsAltKey(event))
|
if (menu_bar_visible_ && IsAltKey(event))
|
||||||
menu_bar_->SetAcceleratorVisibility(
|
menu_bar_->SetAcceleratorVisibility(
|
||||||
event.type == blink::WebInputEvent::RawKeyDown);
|
event.type() == blink::WebInputEvent::RawKeyDown);
|
||||||
|
|
||||||
// Show the submenu when "Alt+Key" is pressed.
|
// Show the submenu when "Alt+Key" is pressed.
|
||||||
if (event.type == blink::WebInputEvent::RawKeyDown && !IsAltKey(event) &&
|
if (event.type() == blink::WebInputEvent::RawKeyDown && !IsAltKey(event) &&
|
||||||
IsAltModifier(event)) {
|
IsAltModifier(event)) {
|
||||||
if (!menu_bar_visible_ &&
|
if (!menu_bar_visible_ &&
|
||||||
(menu_bar_->GetAcceleratorIndex(event.windowsKeyCode) != -1))
|
(menu_bar_->GetAcceleratorIndex(event.windowsKeyCode) != -1))
|
||||||
|
@ -1250,10 +1251,10 @@ void NativeWindowViews::HandleKeyboardEvent(
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Toggle the menu bar only when a single Alt is released.
|
// Toggle the menu bar only when a single Alt is released.
|
||||||
if (event.type == blink::WebInputEvent::RawKeyDown && IsAltKey(event)) {
|
if (event.type() == blink::WebInputEvent::RawKeyDown && IsAltKey(event)) {
|
||||||
// When a single Alt is pressed:
|
// When a single Alt is pressed:
|
||||||
menu_bar_alt_pressed_ = true;
|
menu_bar_alt_pressed_ = true;
|
||||||
} else if (event.type == blink::WebInputEvent::KeyUp && IsAltKey(event) &&
|
} else if (event.type() == blink::WebInputEvent::KeyUp && IsAltKey(event) &&
|
||||||
menu_bar_alt_pressed_) {
|
menu_bar_alt_pressed_) {
|
||||||
// When a single Alt is released right after a Alt is pressed:
|
// When a single Alt is released right after a Alt is pressed:
|
||||||
menu_bar_alt_pressed_ = false;
|
menu_bar_alt_pressed_ = false;
|
||||||
|
|
|
@ -41,7 +41,7 @@ class GtkMessageBox : public NativeWindowObserver {
|
||||||
const gfx::ImageSkia& icon)
|
const gfx::ImageSkia& icon)
|
||||||
: cancel_id_(cancel_id),
|
: cancel_id_(cancel_id),
|
||||||
checkbox_checked_(false),
|
checkbox_checked_(false),
|
||||||
parent_(static_cast<NativeWindowViews*>(parent_window)) {
|
parent_(static_cast<NativeWindow*>(parent_window)) {
|
||||||
// Create dialog.
|
// Create dialog.
|
||||||
dialog_ = gtk_message_dialog_new(
|
dialog_ = gtk_message_dialog_new(
|
||||||
nullptr, // parent
|
nullptr, // parent
|
||||||
|
@ -94,7 +94,7 @@ class GtkMessageBox : public NativeWindowObserver {
|
||||||
// Parent window.
|
// Parent window.
|
||||||
if (parent_) {
|
if (parent_) {
|
||||||
parent_->AddObserver(this);
|
parent_->AddObserver(this);
|
||||||
parent_->SetEnabled(false);
|
static_cast<NativeWindowViews*>(parent_)->SetEnabled(false);
|
||||||
libgtkui::SetGtkTransientForAura(dialog_, parent_->GetNativeWindow());
|
libgtkui::SetGtkTransientForAura(dialog_, parent_->GetNativeWindow());
|
||||||
gtk_window_set_modal(GTK_WINDOW(dialog_), TRUE);
|
gtk_window_set_modal(GTK_WINDOW(dialog_), TRUE);
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ class GtkMessageBox : public NativeWindowObserver {
|
||||||
gtk_widget_destroy(dialog_);
|
gtk_widget_destroy(dialog_);
|
||||||
if (parent_) {
|
if (parent_) {
|
||||||
parent_->RemoveObserver(this);
|
parent_->RemoveObserver(this);
|
||||||
parent_->SetEnabled(true);
|
static_cast<NativeWindowViews*>(parent_)->SetEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ class GtkMessageBox : public NativeWindowObserver {
|
||||||
|
|
||||||
bool checkbox_checked_;
|
bool checkbox_checked_;
|
||||||
|
|
||||||
NativeWindowViews* parent_;
|
NativeWindow* parent_;
|
||||||
GtkWidget* dialog_;
|
GtkWidget* dialog_;
|
||||||
MessageBoxCallback callback_;
|
MessageBoxCallback callback_;
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
|
|
||||||
#include "atom/browser/ui/views/global_menu_bar_x11.h"
|
#include "atom/browser/ui/views/global_menu_bar_x11.h"
|
||||||
|
|
||||||
|
// There are conflicts between Xlib.h and this header.
|
||||||
|
#include "atom/browser/native_window_views.h" // NOLINT
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
// This conflicts with mate::Converter,
|
// This conflicts with mate::Converter,
|
||||||
|
@ -15,7 +18,6 @@
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
|
|
||||||
#include "atom/browser/native_window_views.h"
|
|
||||||
#include "atom/browser/ui/atom_menu_model.h"
|
#include "atom/browser/ui/atom_menu_model.h"
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
|
|
|
@ -36,7 +36,7 @@ SubmenuButton::SubmenuButton(const base::string16& title,
|
||||||
|
|
||||||
if (GetUnderlinePosition(title, &accelerator_, &underline_start_,
|
if (GetUnderlinePosition(title, &accelerator_, &underline_start_,
|
||||||
&underline_end_))
|
&underline_end_))
|
||||||
gfx::Canvas::SizeStringInt(GetText(), GetFontList(), &text_width_,
|
gfx::Canvas::SizeStringInt(GetText(), gfx::FontList(), &text_width_,
|
||||||
&text_height_, 0, 0);
|
&text_height_, 0, 0);
|
||||||
|
|
||||||
SetInkDropMode(InkDropMode::ON);
|
SetInkDropMode(InkDropMode::ON);
|
||||||
|
@ -107,8 +107,8 @@ bool SubmenuButton::GetUnderlinePosition(const base::string16& text,
|
||||||
void SubmenuButton::GetCharacterPosition(
|
void SubmenuButton::GetCharacterPosition(
|
||||||
const base::string16& text, int index, int* pos) {
|
const base::string16& text, int index, int* pos) {
|
||||||
int height = 0;
|
int height = 0;
|
||||||
gfx::Canvas::SizeStringInt(text.substr(0, index), GetFontList(), pos, &height,
|
gfx::Canvas::SizeStringInt(text.substr(0, index), gfx::FontList(), pos,
|
||||||
0, 0);
|
&height, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -280,7 +280,7 @@ bool Converter<blink::WebMouseWheelEvent>::FromV8(
|
||||||
bool can_scroll = true;
|
bool can_scroll = true;
|
||||||
if (dict.Get("canScroll", &can_scroll) && !can_scroll) {
|
if (dict.Get("canScroll", &can_scroll) && !can_scroll) {
|
||||||
out->hasPreciseScrollingDeltas = false;
|
out->hasPreciseScrollingDeltas = false;
|
||||||
out->modifiers &= ~blink::WebInputEvent::ControlKey;
|
out->setModifiers(out->modifiers() | blink::WebInputEvent::ControlKey);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -92,12 +92,12 @@ CertificateManagerModel::CertificateManagerModel(
|
||||||
CertificateManagerModel::~CertificateManagerModel() {
|
CertificateManagerModel::~CertificateManagerModel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int CertificateManagerModel::ImportFromPKCS12(net::CryptoModule* module,
|
int CertificateManagerModel::ImportFromPKCS12(PK11SlotInfo* slot_info,
|
||||||
const std::string& data,
|
const std::string& data,
|
||||||
const base::string16& password,
|
const base::string16& password,
|
||||||
bool is_extractable,
|
bool is_extractable,
|
||||||
net::CertificateList* imported_certs) {
|
net::CertificateList* imported_certs) {
|
||||||
return cert_db_->ImportFromPKCS12(module, data, password,
|
return cert_db_->ImportFromPKCS12(slot_info, data, password,
|
||||||
is_extractable, imported_certs);
|
is_extractable, imported_certs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ class CertificateManagerModel {
|
||||||
// |data|, using the given |password|. If |is_extractable| is false,
|
// |data|, using the given |password|. If |is_extractable| is false,
|
||||||
// mark the private key as unextractable from the module.
|
// mark the private key as unextractable from the module.
|
||||||
// Returns a net error code on failure.
|
// Returns a net error code on failure.
|
||||||
int ImportFromPKCS12(net::CryptoModule* module,
|
int ImportFromPKCS12(PK11SlotInfo* slot_info,
|
||||||
const std::string& data,
|
const std::string& data,
|
||||||
const base::string16& password,
|
const base::string16& password,
|
||||||
bool is_extractable,
|
bool is_extractable,
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
#include "ppapi/proxy/serialized_structs.h"
|
#include "ppapi/proxy/serialized_structs.h"
|
||||||
|
|
||||||
#if defined(OS_LINUX) || defined(OS_OPENBSD)
|
#if defined(OS_LINUX) || defined(OS_OPENBSD)
|
||||||
#include "content/public/common/child_process_sandbox_support_linux.h"
|
#include "content/public/child/child_process_sandbox_support_linux.h"
|
||||||
|
#include "content/public/common/common_sandbox_support_linux.h"
|
||||||
#elif defined(OS_WIN)
|
#elif defined(OS_WIN)
|
||||||
#include "third_party/skia/include/ports/SkFontMgr.h"
|
#include "third_party/skia/include/ports/SkFontMgr.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 5e08ec992316520c3c1643b1e3569f297556b8bb
|
Subproject commit 3e77e9faa16fcbda5fe740e1f2332201cf423c56
|
Loading…
Reference in a new issue