format previously missed chromium_src .cc files

This commit is contained in:
Shelley Vohr 2018-04-17 21:57:05 -04:00
parent 8cc81509d7
commit f7d4437b3f
No known key found for this signature in database
GPG key ID: F13993A75599653C
58 changed files with 688 additions and 898 deletions

View file

@ -52,8 +52,8 @@ void ColorChooserAura::SetSelectedColor(SkColor color) {
}
// static
ColorChooserAura* ColorChooserAura::Open(
content::WebContents* web_contents, SkColor initial_color) {
ColorChooserAura* ColorChooserAura::Open(content::WebContents* web_contents,
SkColor initial_color) {
return new ColorChooserAura(web_contents, initial_color);
}

View file

@ -22,10 +22,7 @@ COLORREF ColorChooserDialog::g_custom_colors[16];
ColorChooserDialog::ExecuteOpenParams::ExecuteOpenParams(SkColor color,
RunState run_state,
HWND owner)
: color(color),
run_state(run_state),
owner(owner) {
}
: color(color), run_state(run_state), owner(owner) {}
ColorChooserDialog::ColorChooserDialog(views::ColorChooserListener* listener,
SkColor initial_color,
@ -36,16 +33,16 @@ ColorChooserDialog::ColorChooserDialog(views::ColorChooserListener* listener,
HWND owning_hwnd = views::HWNDForNativeWindow(owning_window);
ExecuteOpenParams execute_params(initial_color, BeginRun(owning_hwnd),
owning_hwnd);
execute_params.run_state.dialog_thread->task_runner()->PostTask(FROM_HERE,
execute_params.run_state.dialog_thread->task_runner()->PostTask(
FROM_HERE,
base::Bind(&ColorChooserDialog::ExecuteOpen, this, execute_params));
}
ColorChooserDialog::~ColorChooserDialog() {
}
ColorChooserDialog::~ColorChooserDialog() {}
bool ColorChooserDialog::IsRunning(gfx::NativeWindow owning_window) const {
return listener_ && IsRunningDialogForOwner(
views::HWNDForNativeWindow(owning_window));
return listener_ &&
IsRunningDialogForOwner(views::HWNDForNativeWindow(owning_window));
}
void ColorChooserDialog::ListenerDestroyed() {
@ -63,7 +60,8 @@ void ColorChooserDialog::ExecuteOpen(const ExecuteOpenParams& params) {
cc.Flags = CC_ANYCOLOR | CC_FULLOPEN | CC_RGBINIT;
bool success = !!ChooseColor(&cc);
DisableOwner(cc.hwndOwner);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&ColorChooserDialog::DidCloseDialog, this, success,
skia::COLORREFToSkColor(cc.rgbResult), params.run_state));
}

View file

@ -21,8 +21,7 @@ class ColorChooserWin : public content::ColorChooser,
static ColorChooserWin* Open(content::WebContents* web_contents,
SkColor initial_color);
ColorChooserWin(content::WebContents* web_contents,
SkColor initial_color);
ColorChooserWin(content::WebContents* web_contents, SkColor initial_color);
~ColorChooserWin();
// content::ColorChooser overrides:
@ -58,13 +57,12 @@ ColorChooserWin::ColorChooserWin(content::WebContents* web_contents,
SkColor initial_color)
: web_contents_(web_contents) {
gfx::NativeWindow owning_window = web_contents->GetRenderViewHost()
->GetWidget()
->GetView()
->GetNativeView()
->GetToplevelWindow();
color_chooser_dialog_ = new ColorChooserDialog(this,
initial_color,
owning_window);
->GetWidget()
->GetView()
->GetNativeView()
->GetToplevelWindow();
color_chooser_dialog_ =
new ColorChooserDialog(this, initial_color, owning_window);
}
ColorChooserWin::~ColorChooserWin() {

View file

@ -45,24 +45,19 @@ GlobalMenuBarRegistrarX11::GlobalMenuBarRegistrarX11()
// even when |connection_type| is set to SHARED.
g_dbus_proxy_new_for_bus(
G_BUS_TYPE_SESSION,
static_cast<GDBusProxyFlags>(
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS |
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START),
nullptr,
kAppMenuRegistrarName,
kAppMenuRegistrarPath,
static_cast<GDBusProxyFlags>(G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS |
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START),
nullptr, kAppMenuRegistrarName, kAppMenuRegistrarPath,
kAppMenuRegistrarName,
nullptr, // TODO: Probalby want a real cancelable.
static_cast<GAsyncReadyCallback>(OnProxyCreatedThunk),
this);
static_cast<GAsyncReadyCallback>(OnProxyCreatedThunk), this);
}
GlobalMenuBarRegistrarX11::~GlobalMenuBarRegistrarX11() {
if (registrar_proxy_) {
g_signal_handlers_disconnect_by_func(
registrar_proxy_,
reinterpret_cast<void*>(OnNameOwnerChangedThunk),
registrar_proxy_, reinterpret_cast<void*>(OnNameOwnerChangedThunk),
this);
g_object_unref(registrar_proxy_);
}
@ -72,7 +67,7 @@ void GlobalMenuBarRegistrarX11::RegisterXID(unsigned long xid) {
DCHECK(registrar_proxy_);
std::string path = atom::GlobalMenuBarX11::GetPathForWindow(xid);
ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/314087
ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/314087
// TODO(erg): The mozilla implementation goes to a lot of callback trouble
// just to make sure that they react to make sure there's some sort of
// cancelable object; including making a whole callback just to handle the
@ -80,20 +75,16 @@ void GlobalMenuBarRegistrarX11::RegisterXID(unsigned long xid) {
//
// I don't see any reason why we should care if "RegisterWindow" completes or
// not.
g_dbus_proxy_call(registrar_proxy_,
"RegisterWindow",
g_dbus_proxy_call(registrar_proxy_, "RegisterWindow",
g_variant_new("(uo)", xid, path.c_str()),
G_DBUS_CALL_FLAGS_NONE, -1,
nullptr,
nullptr,
nullptr);
G_DBUS_CALL_FLAGS_NONE, -1, nullptr, nullptr, nullptr);
}
void GlobalMenuBarRegistrarX11::UnregisterXID(unsigned long xid) {
DCHECK(registrar_proxy_);
std::string path = atom::GlobalMenuBarX11::GetPathForWindow(xid);
ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/314087
ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/314087
// TODO(erg): The mozilla implementation goes to a lot of callback trouble
// just to make sure that they react to make sure there's some sort of
// cancelable object; including making a whole callback just to handle the
@ -101,13 +92,9 @@ void GlobalMenuBarRegistrarX11::UnregisterXID(unsigned long xid) {
//
// I don't see any reason why we should care if "UnregisterWindow" completes
// or not.
g_dbus_proxy_call(registrar_proxy_,
"UnregisterWindow",
g_variant_new("(u)", xid),
G_DBUS_CALL_FLAGS_NONE, -1,
nullptr,
nullptr,
nullptr);
g_dbus_proxy_call(registrar_proxy_, "UnregisterWindow",
g_variant_new("(u)", xid), G_DBUS_CALL_FLAGS_NONE, -1,
nullptr, nullptr, nullptr);
}
void GlobalMenuBarRegistrarX11::OnProxyCreated(GObject* source,