Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3642)

Unified Diff: chrome/browser/ui/views/frame/top_container_view.cc

Issue 13866026: Adds functionality to anchor widgets to the top-of-window views in immersive mode (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/top_container_view.cc
diff --git a/chrome/browser/ui/views/frame/top_container_view.cc b/chrome/browser/ui/views/frame/top_container_view.cc
index 8e4e6a3eb184da672d5fb96a8330cc09c2b5a295..e597bab0f4fbe8374e5cd21d6562c9aeda22b9d9 100644
--- a/chrome/browser/ui/views/frame/top_container_view.cc
+++ b/chrome/browser/ui/views/frame/top_container_view.cc
@@ -15,6 +15,17 @@ TopContainerView::TopContainerView(BrowserView* browser_view)
TopContainerView::~TopContainerView() {
}
+gfx::Rect TopContainerView::GetTargetBoundsInScreen() const {
+ if (!parent())
+ return bounds();
+
+ gfx::Point origin(parent()->GetBoundsInScreen().origin());
+ origin.Offset(GetMirroredX(), y());
+ if (layer())
+ layer()->GetTargetTransform().TransformPoint(origin);
+ return gfx::Rect(origin, size());
+}
+
gfx::Size TopContainerView::GetPreferredSize() {
// The view wants to be as wide as its parent and tall enough to fully show
// its last child view.
@@ -27,6 +38,13 @@ std::string TopContainerView::GetClassName() const {
return "TopContainerView";
}
+void TopContainerView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
+ ImmersiveModeController* immersive_controller =
+ browser_view_->immersive_mode_controller();
+ if (immersive_controller->IsEnabled())
+ immersive_controller->OnTopContainerBoundsChanged();
+}
+
void TopContainerView::PaintChildren(gfx::Canvas* canvas) {
if (browser_view_->immersive_mode_controller()->IsRevealed()) {
// Top-views depend on parts of the frame (themes, window buttons) being

Powered by Google App Engine
This is Rietveld 408576698