build: remove enable_osr build flag (#38703)
Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
parent
80a3ba5c68
commit
e37111edcc
14 changed files with 21 additions and 108 deletions
|
@ -12,6 +12,8 @@
|
|||
#include "electron/buildflags/buildflags.h"
|
||||
#include "mojo/public/cpp/bindings/associated_remote.h"
|
||||
#include "shell/browser/native_window_views.h"
|
||||
#include "shell/browser/osr/osr_render_widget_host_view.h"
|
||||
#include "shell/browser/osr/osr_view_proxy.h"
|
||||
#include "shell/browser/ui/autofill_popup.h"
|
||||
#include "shell/common/api/api.mojom.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||
|
@ -25,11 +27,6 @@
|
|||
#include "ui/gfx/geometry/vector2d.h"
|
||||
#include "ui/gfx/text_utils.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
#include "shell/browser/osr/osr_render_widget_host_view.h"
|
||||
#include "shell/browser/osr/osr_view_proxy.h"
|
||||
#endif
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
@ -194,7 +191,6 @@ void AutofillPopup::CreateView(content::RenderFrameHost* frame_host,
|
|||
|
||||
view_ = new AutofillPopupView(this, parent->GetWidget());
|
||||
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
if (offscreen) {
|
||||
auto* rwhv = frame_host->GetView();
|
||||
if (embedder_frame_host != nullptr) {
|
||||
|
@ -205,7 +201,6 @@ void AutofillPopup::CreateView(content::RenderFrameHost* frame_host,
|
|||
view_->view_proxy_ = std::make_unique<OffscreenViewProxy>(view_);
|
||||
osr_rwhv->AddViewProxy(view_->view_proxy_.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
// Do this after OSR setup, we check for view_proxy_ when showing
|
||||
view_->Show();
|
||||
|
|
|
@ -48,11 +48,9 @@ AutofillPopupView::~AutofillPopupView() {
|
|||
|
||||
RemoveObserver();
|
||||
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
if (view_proxy_.get()) {
|
||||
view_proxy_->ResetView();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (GetWidget()) {
|
||||
GetWidget()->Close();
|
||||
|
@ -61,9 +59,7 @@ AutofillPopupView::~AutofillPopupView() {
|
|||
|
||||
void AutofillPopupView::Show() {
|
||||
bool visible = parent_widget_->IsVisible();
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
visible = visible || view_proxy_;
|
||||
#endif
|
||||
if (!popup_ || !visible || parent_widget_->IsClosed())
|
||||
return;
|
||||
|
||||
|
@ -228,11 +224,9 @@ void AutofillPopupView::DoUpdateBoundsAndRedrawPopup() {
|
|||
popup_->popup_bounds_.Union(
|
||||
gfx::Rect(popup_->popup_bounds_.origin(), gfx::Size(1, 1)));
|
||||
GetWidget()->SetBounds(popup_->popup_bounds_);
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
if (view_proxy_.get()) {
|
||||
view_proxy_->SetBounds(popup_->popup_bounds_in_view());
|
||||
}
|
||||
#endif
|
||||
SchedulePaint();
|
||||
}
|
||||
|
||||
|
@ -243,7 +237,6 @@ void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
|
|||
gfx::Canvas* draw_canvas = canvas;
|
||||
SkBitmap bitmap;
|
||||
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
std::unique_ptr<cc::SkiaPaintCanvas> paint_canvas;
|
||||
if (view_proxy_.get()) {
|
||||
bitmap.allocN32Pixels(popup_->popup_bounds_in_view().width(),
|
||||
|
@ -251,7 +244,6 @@ void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
|
|||
paint_canvas = std::make_unique<cc::SkiaPaintCanvas>(bitmap);
|
||||
draw_canvas = new gfx::Canvas(paint_canvas.get(), 1.0);
|
||||
}
|
||||
#endif
|
||||
|
||||
draw_canvas->DrawColor(
|
||||
GetColorProvider()->GetColor(ui::kColorResultsTableNormalBackground));
|
||||
|
@ -263,12 +255,10 @@ void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
|
|||
DrawAutofillEntry(draw_canvas, i, line_rect);
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
if (view_proxy_.get()) {
|
||||
view_proxy_->SetBounds(popup_->popup_bounds_in_view());
|
||||
view_proxy_->SetBitmap(bitmap);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void AutofillPopupView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "content/public/browser/native_web_keyboard_event.h"
|
||||
#include "content/public/browser/render_widget_host.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "shell/browser/osr/osr_view_proxy.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/accessibility/ax_node_data.h"
|
||||
#include "ui/views/drag_controller.h"
|
||||
|
@ -20,10 +21,6 @@
|
|||
#include "ui/views/widget/widget_delegate.h"
|
||||
#include "ui/views/widget/widget_observer.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
#include "shell/browser/osr/osr_view_proxy.h"
|
||||
#endif
|
||||
|
||||
namespace electron {
|
||||
|
||||
const int kPopupBorderThickness = 1;
|
||||
|
@ -142,9 +139,7 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
|||
// The index of the currently selected line
|
||||
absl::optional<int> selected_line_;
|
||||
|
||||
#if BUILDFLAG(ENABLE_OSR)
|
||||
std::unique_ptr<OffscreenViewProxy> view_proxy_;
|
||||
#endif
|
||||
|
||||
// The registered keypress callback, responsible for switching lines on
|
||||
// key presses
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue