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

Side by Side Diff: chrome/views/window.cc

Issue 27190: Makes it so windows opened from links in Windows Live Messenger cause the win... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 | « chrome/browser/views/frame/browser_view.cc ('k') | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/window.h" 5 #include "chrome/views/window.h"
6 6
7 #include "base/win_util.h" 7 #include "base/win_util.h"
8 #include "chrome/app/chrome_dll_resource.h" 8 #include "chrome/app/chrome_dll_resource.h"
9 #include "chrome/common/gfx/chrome_font.h" 9 #include "chrome/common/gfx/chrome_font.h"
10 #include "chrome/common/gfx/icon_util.h" 10 #include "chrome/common/gfx/icon_util.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 mi.cbSize = sizeof(mi); 76 mi.cbSize = sizeof(mi);
77 ::GetMonitorInfo(current_monitor, &mi); 77 ::GetMonitorInfo(current_monitor, &mi);
78 working_rect = mi.rcWork; 78 working_rect = mi.rcWork;
79 } 79 }
80 working_rect.Inset(kMonitorEdgePadding, kMonitorEdgePadding); 80 working_rect.Inset(kMonitorEdgePadding, kMonitorEdgePadding);
81 return working_rect.size(); 81 return working_rect.size();
82 } 82 }
83 83
84 void Window::Show() { 84 void Window::Show() {
85 int show_state = GetShowState(); 85 int show_state = GetShowState();
86 bool maximized = false;
87 if (saved_maximized_state_) 86 if (saved_maximized_state_)
88 show_state = SW_SHOWMAXIMIZED; 87 show_state = SW_SHOWMAXIMIZED;
89 Show(show_state); 88 Show(show_state);
90 } 89 }
91 90
92 void Window::Show(int show_state) { 91 void Window::Show(int show_state) {
93 ShowWindow(show_state); 92 ShowWindow(show_state);
93 // When launched from certain programs like bash and Windows Live Messenger,
94 // show_state is set to SW_HIDE, so we need to correct that condition. We
95 // don't just change show_state to SW_SHOWNORMAL because MSDN says we must
96 // always first call ShowWindow with the specified value from STARTUPINFO,
97 // otherwise all future ShowWindow calls will be ignored (!!#@@#!). Instead,
98 // we call ShowWindow again in this case.
99 if (show_state == SW_HIDE)
100 ShowWindow(SW_SHOWNORMAL);
94 SetInitialFocus(); 101 SetInitialFocus();
95 } 102 }
96 103
97 int Window::GetShowState() const { 104 int Window::GetShowState() const {
98 return SW_SHOWNORMAL; 105 return SW_SHOWNORMAL;
99 } 106 }
100 107
101 void Window::Activate() { 108 void Window::Activate() {
102 if (IsMinimized()) 109 if (IsMinimized())
103 ::ShowWindow(GetHWND(), SW_RESTORE); 110 ::ShowWindow(GetHWND(), SW_RESTORE);
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 void Window::InitClass() { 678 void Window::InitClass() {
672 static bool initialized = false; 679 static bool initialized = false;
673 if (!initialized) { 680 if (!initialized) {
674 nwse_cursor_ = LoadCursor(NULL, IDC_SIZENWSE); 681 nwse_cursor_ = LoadCursor(NULL, IDC_SIZENWSE);
675 initialized = true; 682 initialized = true;
676 } 683 }
677 } 684 }
678 685
679 } // namespace views 686 } // namespace views
680 687
OLDNEW
« no previous file with comments | « chrome/browser/views/frame/browser_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698