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

Side by Side Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.cc

Issue 2914793005: [mus+ash] Fixes minimum browser window size (store / retrieve kPreferredSize property) (Closed)
Patch Set: [mus+ash] Fixes minimum browser window size (tests) Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/browser/profiles/profiles_state.h" 9 #include "chrome/browser/profiles/profiles_state.h"
10 #include "chrome/browser/themes/theme_properties.h" 10 #include "chrome/browser/themes/theme_properties.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // clicks in the frame decoration. 219 // clicks in the frame decoration.
220 static_cast<aura::WindowTreeHostMus*>( 220 static_cast<aura::WindowTreeHostMus*>(
221 reveal_widget->GetNativeWindow()->GetHost()) 221 reveal_widget->GetNativeWindow()->GetHost())
222 ->SetClientArea(client_area_insets, additional_client_area); 222 ->SetClientArea(client_area_insets, additional_client_area);
223 } 223 }
224 } else { 224 } else {
225 window_tree_host_mus->SetClientArea(gfx::Insets(), additional_client_area); 225 window_tree_host_mus->SetClientArea(gfx::Insets(), additional_client_area);
226 } 226 }
227 } 227 }
228 228
229 void BrowserNonClientFrameViewMus::UpdateMinimumSize() {
230 gfx::Size min_size = GetMinimumSize();
231 aura::Window* frame_window = frame()->GetNativeWindow();
232 const gfx::Size* previous_min_size =
233 frame_window->GetProperty(aura::client::kMinimumSize);
234 if (!previous_min_size || *previous_min_size != min_size) {
235 frame_window->SetProperty(aura::client::kMinimumSize,
236 new gfx::Size(min_size));
237 }
238 }
239
229 /////////////////////////////////////////////////////////////////////////////// 240 ///////////////////////////////////////////////////////////////////////////////
230 // views::NonClientFrameView: 241 // views::NonClientFrameView:
231 242
232 gfx::Rect BrowserNonClientFrameViewMus::GetBoundsForClientView() const { 243 gfx::Rect BrowserNonClientFrameViewMus::GetBoundsForClientView() const {
233 // The ClientView must be flush with the top edge of the widget so that the 244 // The ClientView must be flush with the top edge of the widget so that the
234 // web contents can take up the entire screen in immersive fullscreen (with 245 // web contents can take up the entire screen in immersive fullscreen (with
235 // or without the top-of-window views revealed). When in immersive fullscreen 246 // or without the top-of-window views revealed). When in immersive fullscreen
236 // and the top-of-window views are revealed, the TopContainerView paints the 247 // and the top-of-window views are revealed, the TopContainerView paints the
237 // window header by redirecting paints from its background to 248 // window header by redirecting paints from its background to
238 // BrowserNonClientFrameViewMus. 249 // BrowserNonClientFrameViewMus.
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 // TODO: move ash_layout_constants to ash/public/cpp. 527 // TODO: move ash_layout_constants to ash/public/cpp.
517 const bool restored = !frame()->IsMaximized() && !frame()->IsFullscreen(); 528 const bool restored = !frame()->IsMaximized() && !frame()->IsFullscreen();
518 return GetAshLayoutSize(restored 529 return GetAshLayoutSize(restored
519 ? AshLayoutSize::BROWSER_RESTORED_CAPTION_BUTTON 530 ? AshLayoutSize::BROWSER_RESTORED_CAPTION_BUTTON
520 : AshLayoutSize::BROWSER_MAXIMIZED_CAPTION_BUTTON) 531 : AshLayoutSize::BROWSER_MAXIMIZED_CAPTION_BUTTON)
521 .height(); 532 .height();
522 #else 533 #else
523 return views::WindowManagerFrameValues::instance().normal_insets.top(); 534 return views::WindowManagerFrameValues::instance().normal_insets.top();
524 #endif 535 #endif
525 } 536 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_non_client_frame_view_mus.h ('k') | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698