9e0a3c44dd
* chore: bump chromium in DEPS to 105.0.5179.0 * chore: update patches * 3758224: Reland^2 "[flags] Enable freezing of flags" https://chromium-review.googlesource.com/c/v8/v8/+/3758224 * chore: bump chromium in DEPS to 105.0.5181.0 * chore: update patches * chore: bump chromium in DEPS to 105.0.5183.0 * chore: bump chromium in DEPS to 105.0.5185.0 * chore: bump chromium in DEPS to 105.0.5187.0 * chore: update patches * 3723298: Pass RemoteFrame mojo channels through its creation messages. https://chromium-review.googlesource.com/c/chromium/src/+/3723298 * 3737382: [Code Heath] Replace base::{ListValue,DictionaryValue} in skia et al https://chromium-review.googlesource.com/c/chromium/src/+/3737382 * Pass RemoteFrame mojo channels through its creation messages. https://chromium-review.googlesource.com/c/chromium/src/+/3723298 * Changed PrintRenderFrame.PrintWithParams mojo interface to use callback. https://chromium-review.googlesource.com/c/chromium/src/+/3761203 * 3738183: [CSP] Add support for `DisableWasmEval` https://chromium-review.googlesource.com/c/chromium/src/+/3738183 * 3740498: Move LinuxUI from //ui/views/linux_ui to //ui/linux https://chromium-review.googlesource.com/c/chromium/src/+/3740498 * 3558277: Moves subsystem and semantics to enum class https://chromium-review.googlesource.com/c/chromium/src/+/3558277 * chore: fix broken steps-electron-gn-check * 3749583: [arm64] Fix undefined symbol linker error https://chromium-review.googlesource.com/c/v8/v8/+/3749583 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
// Copyright (c) 2020 Slack Technologies, Inc.
|
|
// Use of this source code is governed by the MIT license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// Copyright (c) 2020 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "shell/browser/ui/gtk/status_icon.h"
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <memory>
|
|
|
|
#include "base/strings/stringprintf.h"
|
|
#include "shell/browser/ui/gtk/app_indicator_icon.h"
|
|
#include "shell/browser/ui/gtk/gtk_status_icon.h"
|
|
|
|
namespace electron::gtkui {
|
|
|
|
namespace {
|
|
|
|
int indicators_count = 0;
|
|
|
|
}
|
|
|
|
bool IsStatusIconSupported() {
|
|
#if GTK_CHECK_VERSION(3, 90, 0)
|
|
NOTIMPLEMENTED();
|
|
return false;
|
|
#else
|
|
return true;
|
|
#endif
|
|
}
|
|
|
|
std::unique_ptr<ui::StatusIconLinux> CreateLinuxStatusIcon(
|
|
const gfx::ImageSkia& image,
|
|
const std::u16string& tool_tip,
|
|
const char* id_prefix) {
|
|
#if GTK_CHECK_VERSION(3, 90, 0)
|
|
NOTIMPLEMENTED();
|
|
return nullptr;
|
|
#else
|
|
if (AppIndicatorIcon::CouldOpen()) {
|
|
++indicators_count;
|
|
|
|
return std::make_unique<AppIndicatorIcon>(
|
|
base::StringPrintf("%s%d", id_prefix, indicators_count), image,
|
|
tool_tip);
|
|
} else {
|
|
return std::make_unique<GtkStatusIcon>(image, tool_tip);
|
|
}
|
|
#endif
|
|
}
|
|
|
|
} // namespace electron::gtkui
|