OLD | NEW |
---|---|
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 int min_width = std::max(min_frame_width, min_client_view_size.width()); | 329 int min_width = std::max(min_frame_width, min_client_view_size.width()); |
330 if (browser_view()->IsTabStripVisible()) { | 330 if (browser_view()->IsTabStripVisible()) { |
331 // Ensure that the minimum width is enough to hold a minimum width tab strip | 331 // Ensure that the minimum width is enough to hold a minimum width tab strip |
332 // at its usual insets. | 332 // at its usual insets. |
333 int min_tabstrip_width = | 333 int min_tabstrip_width = |
334 browser_view()->tabstrip()->GetMinimumSize().width(); | 334 browser_view()->tabstrip()->GetMinimumSize().width(); |
335 min_width = | 335 min_width = |
336 std::max(min_width, min_tabstrip_width + GetTabStripLeftInset() + | 336 std::max(min_width, min_tabstrip_width + GetTabStripLeftInset() + |
337 GetTabStripRightInset()); | 337 GetTabStripRightInset()); |
338 } | 338 } |
339 return gfx::Size(min_width, min_client_view_size.height()); | 339 gfx::Size min_size(min_width, min_client_view_size.height()); |
340 | |
341 aura::Window* frame_window = frame()->GetNativeWindow(); | |
342 const gfx::Size* min_window_size = | |
343 frame_window->GetProperty(aura::client::kMinimumSize); | |
344 if (!min_window_size || *min_window_size != min_size) { | |
345 frame_window->SetProperty(aura::client::kMinimumSize, | |
346 new gfx::Size(min_size)); | |
347 } | |
348 return min_size; | |
sadrul
2017/06/01 17:14:20
This is the only part that I am a bit worried abou
varkha
2017/06/19 15:57:36
Thanks for the ideas. Did you have something like
| |
340 } | 349 } |
341 | 350 |
342 /////////////////////////////////////////////////////////////////////////////// | 351 /////////////////////////////////////////////////////////////////////////////// |
343 // TabIconViewModel: | 352 // TabIconViewModel: |
344 | 353 |
345 bool BrowserNonClientFrameViewMus::ShouldTabIconViewAnimate() const { | 354 bool BrowserNonClientFrameViewMus::ShouldTabIconViewAnimate() const { |
346 // This function is queried during the creation of the window as the | 355 // This function is queried during the creation of the window as the |
347 // TabIconView we host is initialized, so we need to null check the selected | 356 // TabIconView we host is initialized, so we need to null check the selected |
348 // WebContents because in this condition there is not yet a selected tab. | 357 // WebContents because in this condition there is not yet a selected tab. |
349 content::WebContents* current_tab = browser_view()->GetActiveWebContents(); | 358 content::WebContents* current_tab = browser_view()->GetActiveWebContents(); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
516 // TODO: move ash_layout_constants to ash/public/cpp. | 525 // TODO: move ash_layout_constants to ash/public/cpp. |
517 const bool restored = !frame()->IsMaximized() && !frame()->IsFullscreen(); | 526 const bool restored = !frame()->IsMaximized() && !frame()->IsFullscreen(); |
518 return GetAshLayoutSize(restored | 527 return GetAshLayoutSize(restored |
519 ? AshLayoutSize::BROWSER_RESTORED_CAPTION_BUTTON | 528 ? AshLayoutSize::BROWSER_RESTORED_CAPTION_BUTTON |
520 : AshLayoutSize::BROWSER_MAXIMIZED_CAPTION_BUTTON) | 529 : AshLayoutSize::BROWSER_MAXIMIZED_CAPTION_BUTTON) |
521 .height(); | 530 .height(); |
522 #else | 531 #else |
523 return views::WindowManagerFrameValues::instance().normal_insets.top(); | 532 return views::WindowManagerFrameValues::instance().normal_insets.top(); |
524 #endif | 533 #endif |
525 } | 534 } |
OLD | NEW |