Fix building on Linux

This commit is contained in:
Cheng Zhao 2017-04-17 17:17:02 +09:00
parent 97fd383c53
commit b3d60bfb3a
10 changed files with 28 additions and 24 deletions

View file

@ -453,8 +453,8 @@ int ImportIntoCertStore(
if (!cert_path.empty()) {
if (base::ReadFileToString(base::FilePath(cert_path), &file_data)) {
auto module = model->cert_db()->GetPublicModule();
rv = model->ImportFromPKCS12(module,
auto module = model->cert_db()->GetPrivateSlot();
rv = model->ImportFromPKCS12(module.get(),
file_data,
password,
true,

View file

@ -86,7 +86,7 @@ bool IsAltKey(const content::NativeWebKeyboardEvent& event) {
bool IsAltModifier(const content::NativeWebKeyboardEvent& event) {
typedef content::NativeWebKeyboardEvent::Modifiers Modifiers;
int modifiers = event.modifiers;
int modifiers = event.modifiers();
modifiers &= ~Modifiers::NumLockOn;
modifiers &= ~Modifiers::CapsLockOn;
return (modifiers == Modifiers::AltKey) ||
@ -767,13 +767,14 @@ void NativeWindowViews::SetBackgroundColor(const std::string& color_name) {
}
void NativeWindowViews::SetHasShadow(bool has_shadow) {
wm::SetShadowType(
wm::SetShadowElevation(
GetNativeWindow(),
has_shadow ? wm::SHADOW_TYPE_RECTANGULAR : wm::SHADOW_TYPE_NONE);
has_shadow ? wm::ShadowElevation::MEDIUM : wm::ShadowElevation::NONE);
}
bool NativeWindowViews::HasShadow() {
return wm::GetShadowType(GetNativeWindow()) != wm::SHADOW_TYPE_NONE;
return GetNativeWindow()->GetProperty(wm::kShadowElevationKey)
!= wm::ShadowElevation::NONE;
}
void NativeWindowViews::SetIgnoreMouseEvents(bool ignore) {
@ -1234,10 +1235,10 @@ void NativeWindowViews::HandleKeyboardEvent(
// Show accelerator when "Alt" is pressed.
if (menu_bar_visible_ && IsAltKey(event))
menu_bar_->SetAcceleratorVisibility(
event.type == blink::WebInputEvent::RawKeyDown);
event.type() == blink::WebInputEvent::RawKeyDown);
// 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)) {
if (!menu_bar_visible_ &&
(menu_bar_->GetAcceleratorIndex(event.windowsKeyCode) != -1))
@ -1250,10 +1251,10 @@ void NativeWindowViews::HandleKeyboardEvent(
return;
// 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:
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_) {
// When a single Alt is released right after a Alt is pressed:
menu_bar_alt_pressed_ = false;

View file

@ -41,7 +41,7 @@ class GtkMessageBox : public NativeWindowObserver {
const gfx::ImageSkia& icon)
: cancel_id_(cancel_id),
checkbox_checked_(false),
parent_(static_cast<NativeWindowViews*>(parent_window)) {
parent_(static_cast<NativeWindow*>(parent_window)) {
// Create dialog.
dialog_ = gtk_message_dialog_new(
nullptr, // parent
@ -94,7 +94,7 @@ class GtkMessageBox : public NativeWindowObserver {
// Parent window.
if (parent_) {
parent_->AddObserver(this);
parent_->SetEnabled(false);
static_cast<NativeWindowViews*>(parent_)->SetEnabled(false);
libgtkui::SetGtkTransientForAura(dialog_, parent_->GetNativeWindow());
gtk_window_set_modal(GTK_WINDOW(dialog_), TRUE);
}
@ -104,7 +104,7 @@ class GtkMessageBox : public NativeWindowObserver {
gtk_widget_destroy(dialog_);
if (parent_) {
parent_->RemoveObserver(this);
parent_->SetEnabled(true);
static_cast<NativeWindowViews*>(parent_)->SetEnabled(true);
}
}
@ -179,7 +179,7 @@ class GtkMessageBox : public NativeWindowObserver {
bool checkbox_checked_;
NativeWindowViews* parent_;
NativeWindow* parent_;
GtkWidget* dialog_;
MessageBoxCallback callback_;

View file

@ -4,6 +4,9 @@
#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>
// This conflicts with mate::Converter,
@ -15,7 +18,6 @@
#include <dlfcn.h>
#include <glib-object.h>
#include "atom/browser/native_window_views.h"
#include "atom/browser/ui/atom_menu_model.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"

View file

@ -36,7 +36,7 @@ SubmenuButton::SubmenuButton(const base::string16& title,
if (GetUnderlinePosition(title, &accelerator_, &underline_start_,
&underline_end_))
gfx::Canvas::SizeStringInt(GetText(), GetFontList(), &text_width_,
gfx::Canvas::SizeStringInt(GetText(), gfx::FontList(), &text_width_,
&text_height_, 0, 0);
SetInkDropMode(InkDropMode::ON);
@ -107,8 +107,8 @@ bool SubmenuButton::GetUnderlinePosition(const base::string16& text,
void SubmenuButton::GetCharacterPosition(
const base::string16& text, int index, int* pos) {
int height = 0;
gfx::Canvas::SizeStringInt(text.substr(0, index), GetFontList(), pos, &height,
0, 0);
gfx::Canvas::SizeStringInt(text.substr(0, index), gfx::FontList(), pos,
&height, 0, 0);
}
} // namespace atom

View file

@ -280,7 +280,7 @@ bool Converter<blink::WebMouseWheelEvent>::FromV8(
bool can_scroll = true;
if (dict.Get("canScroll", &can_scroll) && !can_scroll) {
out->hasPreciseScrollingDeltas = false;
out->modifiers &= ~blink::WebInputEvent::ControlKey;
out->setModifiers(out->modifiers() | blink::WebInputEvent::ControlKey);
}
#endif
return true;

View file

@ -92,12 +92,12 @@ CertificateManagerModel::CertificateManagerModel(
CertificateManagerModel::~CertificateManagerModel() {
}
int CertificateManagerModel::ImportFromPKCS12(net::CryptoModule* module,
int CertificateManagerModel::ImportFromPKCS12(PK11SlotInfo* slot_info,
const std::string& data,
const base::string16& password,
bool is_extractable,
net::CertificateList* imported_certs) {
return cert_db_->ImportFromPKCS12(module, data, password,
return cert_db_->ImportFromPKCS12(slot_info, data, password,
is_extractable, imported_certs);
}

View file

@ -44,7 +44,7 @@ class CertificateManagerModel {
// |data|, using the given |password|. If |is_extractable| is false,
// mark the private key as unextractable from the module.
// Returns a net error code on failure.
int ImportFromPKCS12(net::CryptoModule* module,
int ImportFromPKCS12(PK11SlotInfo* slot_info,
const std::string& data,
const base::string16& password,
bool is_extractable,

View file

@ -15,7 +15,8 @@
#include "ppapi/proxy/serialized_structs.h"
#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)
#include "third_party/skia/include/ports/SkFontMgr.h"
#endif

2
vendor/brightray vendored

@ -1 +1 @@
Subproject commit 5e08ec992316520c3c1643b1e3569f297556b8bb
Subproject commit 3e77e9faa16fcbda5fe740e1f2332201cf423c56