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

Side by Side Diff: ui/views/widget/native_widget_win.cc

Issue 10815006: Layout in the ShellWindow becomes chaos (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: update patch to not cut relayout code patch cruelly. Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/widget/native_widget_win.h" 5 #include "ui/views/widget/native_widget_win.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 2477 matching lines...) Expand 10 before | Expand all | Expand 10 after
2488 lock_updates_count_ = 0; 2488 lock_updates_count_ = 0;
2489 } 2489 }
2490 } 2490 }
2491 2491
2492 bool NativeWidgetWin::WidgetSizeIsClientSize() const { 2492 bool NativeWidgetWin::WidgetSizeIsClientSize() const {
2493 const Widget* widget = GetWidget()->GetTopLevelWidget(); 2493 const Widget* widget = GetWidget()->GetTopLevelWidget();
2494 return IsZoomed() || (widget && widget->ShouldUseNativeFrame()); 2494 return IsZoomed() || (widget && widget->ShouldUseNativeFrame());
2495 } 2495 }
2496 2496
2497 void NativeWidgetWin::ClientAreaSizeChanged() { 2497 void NativeWidgetWin::ClientAreaSizeChanged() {
2498 RECT r; 2498 RECT r = {0, 0, 0, 0};
2499 if (WidgetSizeIsClientSize()) 2499 if (WidgetSizeIsClientSize()) {
2500 GetClientRect(&r); 2500 if (!IsMinimized())
2501 else 2501 GetClientRect(&r);
2502 } else
2502 GetWindowRect(&r); 2503 GetWindowRect(&r);
Ben Goodger (Google) 2012/08/06 19:32:35 braces around else too.
2503 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), 2504 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)),
2504 std::max(0, static_cast<int>(r.bottom - r.top))); 2505 std::max(0, static_cast<int>(r.bottom - r.top)));
2505 delegate_->OnNativeWidgetSizeChanged(s); 2506 delegate_->OnNativeWidgetSizeChanged(s);
2506 if (use_layered_buffer_) 2507 if (use_layered_buffer_)
2507 layered_window_contents_.reset( 2508 layered_window_contents_.reset(
2508 new gfx::Canvas(s, ui::SCALE_FACTOR_100P, false)); 2509 new gfx::Canvas(s, ui::SCALE_FACTOR_100P, false));
2509 } 2510 }
2510 2511
2511 void NativeWidgetWin::UpdateDWMFrame() { 2512 void NativeWidgetWin::UpdateDWMFrame() {
2512 MARGINS m = {10, 10, 10, 10}; 2513 MARGINS m = {10, 10, 10, 10};
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2761 // static 2762 // static
2762 bool NativeWidgetPrivate::IsTouchDown() { 2763 bool NativeWidgetPrivate::IsTouchDown() {
2763 // This currently isn't necessary because we're not generating touch events on 2764 // This currently isn't necessary because we're not generating touch events on
2764 // windows. When we do, this will need to be updated. 2765 // windows. When we do, this will need to be updated.
2765 return false; 2766 return false;
2766 } 2767 }
2767 2768
2768 } // namespace internal 2769 } // namespace internal
2769 2770
2770 } // namespace views 2771 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698