Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions shell/browser/native_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ gfx::Size GetExpandedWindowSize(const NativeWindow* window, gfx::Size size) {
NativeWindow::NativeWindow(const gin_helper::Dictionary& options,
NativeWindow* parent)
: widget_(std::make_unique<views::Widget>()), parent_(parent) {
++next_id_;

options.Get(options::kFrame, &has_frame_);
options.Get(options::kTransparent, &transparent_);
options.Get(options::kEnableLargerThanScreen, &enable_larger_than_screen_);
Expand Down Expand Up @@ -816,9 +814,6 @@ void NativeWindow::HandlePendingFullscreenTransitions() {
SetFullScreen(next_transition);
}

// static
int32_t NativeWindow::next_id_ = 0;

bool NativeWindow::IsTranslucent() const {
// Transparent windows are translucent
if (transparent()) {
Expand Down
5 changes: 3 additions & 2 deletions shell/browser/native_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ class NativeWindow : public base::SupportsUserData,
NativeWindow* parent() const { return parent_; }
bool is_modal() const { return is_modal_; }

int32_t window_id() const { return next_id_; }
int32_t window_id() const { return window_id_; }

void add_child_window(NativeWindow* child) {
child_windows_.push_back(child);
Expand Down Expand Up @@ -470,7 +470,8 @@ class NativeWindow : public base::SupportsUserData,
private:
std::unique_ptr<views::Widget> widget_;

static int32_t next_id_;
static inline int32_t next_id_ = 0;
const int32_t window_id_ = ++next_id_;

// The content view, weak ref.
raw_ptr<views::View> content_view_ = nullptr;
Expand Down