Skip to content

Commit

Permalink
Make ChromeBrowserMainExtraPartsViewsLacros own chromeos::TabletState
Browse files Browse the repository at this point in the history
chromeos::TabletState's functionality will be embedded into
display::ScreenBase in the future. But for now, remove direct
references to it from //ui/ozone/platform/wayland.

This CL also works as a precursor CL to crrev.com/c/2491517
(see relation chain), given that chromeos::TabletState instances
will need to have PlatformScreen instance already set up.

BUG=1113900
R=jamescook@chromium.org, rjkroege@chromium.org

Change-Id: I2c89775deabae2a4a16aa45a35c707739b463a16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505608
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: Maksim Sisov (GMT+2) <msisov@igalia.com>
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Nick Yamane <nickdiego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#822135}
  • Loading branch information
tonikitoo authored and Commit Bot committed Oct 29, 2020
1 parent 570e487 commit 41e3137
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_lacros.h"

#include "chrome/browser/lacros/immersive_context_lacros.h"
#include "chromeos/ui/base/tablet_state.h"

ChromeBrowserMainExtraPartsViewsLacros::
ChromeBrowserMainExtraPartsViewsLacros() = default;
Expand All @@ -14,6 +15,7 @@ ChromeBrowserMainExtraPartsViewsLacros::

void ChromeBrowserMainExtraPartsViewsLacros::PreProfileInit() {
immersive_context_ = std::make_unique<ImmersiveContextLacros>();
tablet_state_ = std::make_unique<chromeos::TabletState>();

ChromeBrowserMainExtraPartsViews::PreProfileInit();
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

#include <memory>

namespace chromeos {
class TabletState;
}

class ImmersiveContextLacros;

class ChromeBrowserMainExtraPartsViewsLacros
Expand All @@ -26,6 +30,7 @@ class ChromeBrowserMainExtraPartsViewsLacros
void PreProfileInit() override;

std::unique_ptr<ImmersiveContextLacros> immersive_context_;
std::unique_ptr<chromeos::TabletState> tablet_state_;
};

#endif // CHROME_BROWSER_UI_VIEWS_CHROME_BROWSER_MAIN_EXTRA_PARTS_VIEWS_LACROS_H_
5 changes: 1 addition & 4 deletions ui/ozone/platform/wayland/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,7 @@ source_set("wayland") {

# TODO(crbug.com/1052397): Rename chromeos_is_browser_only to is_lacros.
if (chromeos_is_browser_only) {
deps += [
"//chromeos/crosapi/cpp",
"//chromeos/ui/base",
]
deps += [ "//chromeos/crosapi/cpp" ]
}

defines = [ "OZONE_IMPLEMENTATION" ]
Expand Down
9 changes: 0 additions & 9 deletions ui/ozone/platform/wayland/host/wayland_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <memory>
#include <vector>

#include "build/chromeos_buildflags.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/events/event.h"
#include "ui/ozone/platform/wayland/common/wayland_object.h"
Expand All @@ -17,10 +16,6 @@
#include "ui/ozone/platform/wayland/host/wayland_data_source.h"
#include "ui/ozone/platform/wayland/host/wayland_window_manager.h"

#if BUILDFLAG(IS_LACROS)
#include "chromeos/ui/base/tablet_state.h"
#endif

namespace gfx {
class Point;
}
Expand Down Expand Up @@ -241,10 +236,6 @@ class WaylandConnection {
// Manages Wayland windows.
WaylandWindowManager wayland_window_manager_;

#if BUILDFLAG(IS_LACROS)
chromeos::TabletState tablet_state_;
#endif

bool scheduled_flush_ = false;

EventSerial serial_;
Expand Down

0 comments on commit 41e3137

Please sign in to comment.