chore: bump chromium to e049d599a8332b9b2785b0178be74 (master) (#20314)
This commit is contained in:
parent
0090616f7b
commit
3ac3fbdbfb
94 changed files with 670 additions and 1213 deletions
|
@ -163,7 +163,7 @@ using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle;
|
|||
// store the current status window level to be restored in
|
||||
// windowDidDeminiaturize
|
||||
level_ = [window level];
|
||||
[window setLevel:NSNormalWindowLevel];
|
||||
shell_->SetWindowLevel(NSNormalWindowLevel);
|
||||
}
|
||||
|
||||
- (void)windowDidMiniaturize:(NSNotification*)notification {
|
||||
|
@ -173,7 +173,7 @@ using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle;
|
|||
|
||||
- (void)windowDidDeminiaturize:(NSNotification*)notification {
|
||||
[super windowDidDeminiaturize:notification];
|
||||
[shell_->GetNativeWindow().GetNativeNSWindow() setLevel:level_];
|
||||
shell_->SetWindowLevel(level_);
|
||||
shell_->NotifyWindowRestore();
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "shell/browser/ui/inspectable_web_contents_view_delegate.h"
|
||||
#include "shell/common/platform_util.h"
|
||||
#include "third_party/blink/public/common/logging/logging_utils.h"
|
||||
#include "third_party/blink/public/common/page/page_zoom.h"
|
||||
#include "ui/display/display.h"
|
||||
#include "ui/display/screen.h"
|
||||
|
||||
|
@ -122,15 +123,15 @@ void SetZoomLevelForWebContents(content::WebContents* web_contents,
|
|||
}
|
||||
|
||||
double GetNextZoomLevel(double level, bool out) {
|
||||
double factor = content::ZoomLevelToZoomFactor(level);
|
||||
double factor = blink::PageZoomLevelToZoomFactor(level);
|
||||
size_t size = base::size(kPresetZoomFactors);
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
if (!content::ZoomValuesEqual(kPresetZoomFactors[i], factor))
|
||||
if (!blink::PageZoomValuesEqual(kPresetZoomFactors[i], factor))
|
||||
continue;
|
||||
if (out && i > 0)
|
||||
return content::ZoomFactorToZoomLevel(kPresetZoomFactors[i - 1]);
|
||||
return blink::PageZoomFactorToZoomLevel(kPresetZoomFactors[i - 1]);
|
||||
if (!out && i != size - 1)
|
||||
return content::ZoomFactorToZoomLevel(kPresetZoomFactors[i + 1]);
|
||||
return blink::PageZoomFactorToZoomLevel(kPresetZoomFactors[i + 1]);
|
||||
}
|
||||
return level;
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/ui/views/status_icons/status_icon_linux_dbus.h"
|
||||
#include "shell/browser/browser.h"
|
||||
#include "shell/common/application_info.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
#include "ui/views/linux_ui/linux_ui.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
|
@ -18,38 +18,40 @@ TrayIconGtk::TrayIconGtk() = default;
|
|||
TrayIconGtk::~TrayIconGtk() = default;
|
||||
|
||||
void TrayIconGtk::SetImage(const gfx::Image& image) {
|
||||
image_ = image.AsImageSkia();
|
||||
if (icon_) {
|
||||
icon_->SetIcon(image.AsImageSkia());
|
||||
icon_->SetIcon(image_);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto toolTip = base::UTF8ToUTF16(GetApplicationName());
|
||||
icon_ = views::LinuxUI::instance()->CreateLinuxStatusIcon(
|
||||
image.AsImageSkia(), toolTip, Browser::Get()->GetName().c_str());
|
||||
tool_tip_ = base::UTF8ToUTF16(GetApplicationName());
|
||||
|
||||
icon_ = base::MakeRefCounted<StatusIconLinuxDbus>();
|
||||
icon_->SetIcon(image_);
|
||||
icon_->SetToolTip(tool_tip_);
|
||||
icon_->SetDelegate(this);
|
||||
}
|
||||
|
||||
void TrayIconGtk::SetToolTip(const std::string& tool_tip) {
|
||||
icon_->SetToolTip(base::UTF8ToUTF16(tool_tip));
|
||||
tool_tip_ = base::UTF8ToUTF16(tool_tip);
|
||||
icon_->SetToolTip(tool_tip_);
|
||||
}
|
||||
|
||||
void TrayIconGtk::SetContextMenu(AtomMenuModel* menu_model) {
|
||||
icon_->UpdatePlatformContextMenu(menu_model);
|
||||
icon_->UpdatePlatformContextMenu(menu_model_);
|
||||
menu_model_ = menu_model;
|
||||
}
|
||||
|
||||
const gfx::ImageSkia& TrayIconGtk::GetImage() const {
|
||||
NOTREACHED();
|
||||
return dummy_image_;
|
||||
return image_;
|
||||
}
|
||||
|
||||
const base::string16& TrayIconGtk::GetToolTip() const {
|
||||
NOTREACHED();
|
||||
return dummy_string_;
|
||||
return tool_tip_;
|
||||
}
|
||||
|
||||
ui::MenuModel* TrayIconGtk::GetMenuModel() const {
|
||||
NOTREACHED();
|
||||
return nullptr;
|
||||
return menu_model_;
|
||||
}
|
||||
|
||||
void TrayIconGtk::OnImplInitializationFailed() {}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "chrome/browser/ui/views/status_icons/status_icon_linux_dbus.h"
|
||||
#include "shell/browser/ui/tray_icon.h"
|
||||
#include "ui/views/linux_ui/status_icon_linux.h"
|
||||
|
||||
|
@ -38,10 +39,10 @@ class TrayIconGtk : public TrayIcon, public views::StatusIconLinux::Delegate {
|
|||
void OnImplInitializationFailed() override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<views::StatusIconLinux> icon_;
|
||||
|
||||
gfx::ImageSkia dummy_image_;
|
||||
base::string16 dummy_string_;
|
||||
scoped_refptr<StatusIconLinuxDbus> icon_;
|
||||
gfx::ImageSkia image_;
|
||||
base::string16 tool_tip_;
|
||||
ui::MenuModel* menu_model_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TrayIconGtk);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue