Fix Debug building on Windows
This commit is contained in:
parent
6165d36351
commit
55d4d44f02
15 changed files with 52 additions and 79 deletions
|
@ -20,6 +20,7 @@
|
|||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/context_factory.h"
|
||||
#include "content/public/browser/render_widget_host_view_frame_subscriber.h"
|
||||
#include "ui/compositor/compositor.h"
|
||||
#include "ui/compositor/layer.h"
|
||||
#include "ui/compositor/layer_type.h"
|
||||
#include "ui/events/latency_info.h"
|
||||
|
@ -349,14 +350,16 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
|
|||
is_showing_(!render_widget_host_->is_hidden()),
|
||||
size_(native_window->GetSize()),
|
||||
painting_(true),
|
||||
#if !defined(OS_MACOSX)
|
||||
delegated_frame_host_(new content::DelegatedFrameHost(this)),
|
||||
#endif
|
||||
weak_ptr_factory_(this) {
|
||||
DCHECK(render_widget_host_);
|
||||
render_widget_host_->SetView(this);
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
content::ImageTransportFactory* factory =
|
||||
content::ImageTransportFactory::GetInstance();
|
||||
delegated_frame_host_ = base::MakeUnique<content::DelegatedFrameHost>(
|
||||
factory->GetContextFactory()->AllocateFrameSinkId(), this);
|
||||
|
||||
root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
|
||||
#endif
|
||||
|
||||
|
@ -743,16 +746,6 @@ OffScreenRenderWidgetHostView::DelegatedFrameHostSendReclaimCompositorResources(
|
|||
resources));
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::
|
||||
DelegatedFrameHostOnLostCompositorResources() {
|
||||
render_widget_host_->ScheduleComposite();
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::DelegatedFrameHostUpdateVSyncParameters(
|
||||
const base::TimeTicks& timebase, const base::TimeDelta& interval) {
|
||||
render_widget_host_->UpdateVSyncParameters(timebase, interval);
|
||||
}
|
||||
|
||||
void OffScreenRenderWidgetHostView::SetBeginFrameSource(
|
||||
cc::BeginFrameSource* source) {
|
||||
}
|
||||
|
|
|
@ -160,12 +160,9 @@ class OffScreenRenderWidgetHostView
|
|||
bool defer_compositor_lock) override;
|
||||
void DelegatedFrameHostResizeLockWasReleased(void) override;
|
||||
void DelegatedFrameHostSendReclaimCompositorResources(
|
||||
int output_surface_id,
|
||||
bool is_swap_ack,
|
||||
const cc::ReturnedResourceArray& resources) override;
|
||||
void DelegatedFrameHostOnLostCompositorResources(void) override;
|
||||
void DelegatedFrameHostUpdateVSyncParameters(
|
||||
const base::TimeTicks &, const base::TimeDelta &) override;
|
||||
int output_surface_id,
|
||||
bool is_swap_ack,
|
||||
const cc::ReturnedResourceArray& resources) override;
|
||||
void SetBeginFrameSource(cc::BeginFrameSource* source) override;
|
||||
#endif // !defined(OS_MACOSX)
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "ui/display/screen.h"
|
||||
#include "ui/gfx/geometry/point.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
#include "ui/wm/public/drag_drop_client.h"
|
||||
#include "ui/aura/client/drag_drop_client.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
#include "base/win/registry.h"
|
||||
#include "third_party/wtl/include/atlapp.h"
|
||||
#include "third_party/wtl/include/atldlgs.h"
|
||||
|
@ -143,7 +144,7 @@ class FileDialog {
|
|||
|
||||
struct RunState {
|
||||
base::Thread* dialog_thread;
|
||||
base::MessageLoop* ui_message_loop;
|
||||
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner;
|
||||
};
|
||||
|
||||
bool CreateDialogThread(RunState* run_state) {
|
||||
|
@ -154,7 +155,7 @@ bool CreateDialogThread(RunState* run_state) {
|
|||
return false;
|
||||
|
||||
run_state->dialog_thread = thread.release();
|
||||
run_state->ui_message_loop = base::MessageLoop::current();
|
||||
run_state->ui_task_runner = base::ThreadTaskRunnerHandle::Get();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -169,9 +170,9 @@ void RunOpenDialogInNewThread(const RunState& run_state,
|
|||
std::vector<base::FilePath> paths;
|
||||
bool result = ShowOpenDialog(parent, title, button_label, default_path,
|
||||
filters, properties, &paths);
|
||||
run_state.ui_message_loop->PostTask(FROM_HERE,
|
||||
run_state.ui_task_runner->PostTask(FROM_HERE,
|
||||
base::Bind(callback, result, paths));
|
||||
run_state.ui_message_loop->DeleteSoon(FROM_HERE, run_state.dialog_thread);
|
||||
run_state.ui_task_runner->DeleteSoon(FROM_HERE, run_state.dialog_thread);
|
||||
}
|
||||
|
||||
void RunSaveDialogInNewThread(const RunState& run_state,
|
||||
|
@ -184,9 +185,9 @@ void RunSaveDialogInNewThread(const RunState& run_state,
|
|||
base::FilePath path;
|
||||
bool result = ShowSaveDialog(parent, title, button_label, default_path,
|
||||
filters, &path);
|
||||
run_state.ui_message_loop->PostTask(FROM_HERE,
|
||||
base::Bind(callback, result, path));
|
||||
run_state.ui_message_loop->DeleteSoon(FROM_HERE, run_state.dialog_thread);
|
||||
run_state.ui_task_runner->PostTask(FROM_HERE,
|
||||
base::Bind(callback, result, path));
|
||||
run_state.ui_task_runner->DeleteSoon(FROM_HERE, run_state.dialog_thread);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -256,7 +257,7 @@ void ShowOpenDialog(atom::NativeWindow* parent,
|
|||
return;
|
||||
}
|
||||
|
||||
run_state.dialog_thread->message_loop()->PostTask(
|
||||
run_state.dialog_thread->task_runner()->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(&RunOpenDialogInNewThread, run_state, parent, title,
|
||||
button_label, default_path, filters, properties, callback));
|
||||
|
@ -295,7 +296,7 @@ void ShowSaveDialog(atom::NativeWindow* parent,
|
|||
return;
|
||||
}
|
||||
|
||||
run_state.dialog_thread->message_loop()->PostTask(
|
||||
run_state.dialog_thread->task_runner()->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(&RunSaveDialogInNewThread, run_state, parent, title,
|
||||
button_label, default_path, filters, callback));
|
||||
|
|
|
@ -233,7 +233,7 @@ void ShowMessageBox(NativeWindow* parent,
|
|||
}
|
||||
|
||||
base::Thread* unretained = thread.release();
|
||||
unretained->message_loop()->PostTask(
|
||||
unretained->task_runner()->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(&RunMessageBoxInNewThread, base::Unretained(unretained),
|
||||
parent, type, buttons, default_id, cancel_id, options, title,
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "ui/gfx/color_utils.h"
|
||||
#include "ui/gfx/text_utils.h"
|
||||
#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
|
||||
#include "ui/views/animation/ink_drop_impl.h"
|
||||
#include "ui/views/animation/ink_drop_host_view.h"
|
||||
#include "ui/views/controls/button/label_button_border.h"
|
||||
|
||||
|
@ -59,28 +60,20 @@ SubmenuButton::~SubmenuButton() {
|
|||
|
||||
std::unique_ptr<views::InkDropRipple> SubmenuButton::CreateInkDropRipple()
|
||||
const {
|
||||
return base::MakeUnique<views::FloodFillInkDropRipple>(
|
||||
GetLocalBounds(),
|
||||
GetInkDropCenterBasedOnLastEvent(),
|
||||
GetInkDropBaseColor(),
|
||||
ink_drop_visible_opacity());
|
||||
std::unique_ptr<views::InkDropRipple> ripple(
|
||||
new views::FloodFillInkDropRipple(
|
||||
size(),
|
||||
GetInkDropCenterBasedOnLastEvent(),
|
||||
GetInkDropBaseColor(),
|
||||
ink_drop_visible_opacity()));
|
||||
return ripple;
|
||||
}
|
||||
|
||||
std::unique_ptr<views::InkDropHighlight>
|
||||
SubmenuButton::CreateInkDropHighlight() const {
|
||||
if (!ShouldShowInkDropHighlight())
|
||||
return nullptr;
|
||||
|
||||
gfx::Size size = GetLocalBounds().size();
|
||||
return base::MakeUnique<views::InkDropHighlight>(
|
||||
size,
|
||||
kInkDropSmallCornerRadius,
|
||||
gfx::RectF(gfx::SizeF(size)).CenterPoint(),
|
||||
GetInkDropBaseColor());
|
||||
}
|
||||
|
||||
bool SubmenuButton::ShouldShowInkDropForFocus() const {
|
||||
return false;
|
||||
std::unique_ptr<views::InkDrop> SubmenuButton::CreateInkDrop() {
|
||||
std::unique_ptr<views::InkDropImpl> ink_drop =
|
||||
CustomButton::CreateDefaultInkDropImpl();
|
||||
ink_drop->SetShowHighlightOnHover(false);
|
||||
return std::move(ink_drop);
|
||||
}
|
||||
|
||||
void SubmenuButton::SetAcceleratorVisibility(bool visible) {
|
||||
|
|
|
@ -31,9 +31,7 @@ class SubmenuButton : public views::MenuButton {
|
|||
|
||||
// views::InkDropHostView:
|
||||
std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
|
||||
std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
|
||||
const override;
|
||||
bool ShouldShowInkDropForFocus() const override;
|
||||
std::unique_ptr<views::InkDrop> CreateInkDrop() override;
|
||||
|
||||
private:
|
||||
bool GetUnderlinePosition(const base::string16& text,
|
||||
|
|
|
@ -86,9 +86,8 @@ NotifyIconHost::~NotifyIconHost() {
|
|||
if (atom_)
|
||||
UnregisterClass(MAKEINTATOM(atom_), instance_);
|
||||
|
||||
NotifyIcons copied_container(notify_icons_);
|
||||
base::STLDeleteContainerPointers(
|
||||
copied_container.begin(), copied_container.end());
|
||||
for (NotifyIcon* ptr : notify_icons_)
|
||||
delete ptr;
|
||||
}
|
||||
|
||||
NotifyIcon* NotifyIconHost::CreateNotifyIcon() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue