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

Side by Side Diff: chrome_frame/infobars/internal/displaced_window_manager.cc

Issue 126143005: Remove Chrome Frame code and resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to r244038 Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome_frame/infobars/internal/displaced_window_manager.h"
6
7 DisplacedWindowManager::DisplacedWindowManager() {
8 }
9
10 void DisplacedWindowManager::UpdateLayout() {
11 // Call SetWindowPos with SWP_FRAMECHANGED for displaced window.
12 // Displaced window will receive WM_NCCALCSIZE to recalculate its client size.
13 ::SetWindowPos(m_hWnd,
14 NULL, 0, 0, 0, 0,
15 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |
16 SWP_FRAMECHANGED);
17 }
18
19 LRESULT DisplacedWindowManager::OnNcCalcSize(BOOL calc_valid_rects,
20 LPARAM lparam) {
21 // Ask the original window proc to calculate the 'natural' size of the window.
22 LRESULT ret = DefWindowProc(WM_NCCALCSIZE,
23 static_cast<WPARAM>(calc_valid_rects), lparam);
24 if (lparam == NULL)
25 return ret;
26
27 // Whether calc_valid_rects is true or false, we could treat beginning of
28 // lparam as a RECT object.
29 RECT* rect = reinterpret_cast<RECT*>(lparam);
30 RECT natural_rect = *rect;
31 if (delegate() != NULL)
32 delegate()->AdjustDisplacedWindowDimensions(rect);
33
34 // If we modified the window's dimensions, there is no way to respect a custom
35 // "client-area preservation strategy", so we must force a redraw to be safe.
36 if (calc_valid_rects && ret == WVR_VALIDRECTS &&
37 !EqualRect(&natural_rect, rect)) {
38 ret = WVR_REDRAW;
39 }
40
41 return ret;
42 }
OLDNEW
« no previous file with comments | « chrome_frame/infobars/internal/displaced_window_manager.h ('k') | chrome_frame/infobars/internal/host_window_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698