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

Side by Side Diff: ui/views/win/hwnd_message_handler.cc

Issue 118283003: Make Widget::Show() creates active windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more ShowInactive() calls 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
« no previous file with comments | « ui/views/widget/widget_unittest.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) 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/win/hwnd_message_handler.h" 5 #include "ui/views/win/hwnd_message_handler.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); 552 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
553 } 553 }
554 554
555 void HWNDMessageHandler::StackAtTop() { 555 void HWNDMessageHandler::StackAtTop() {
556 SetWindowPos(hwnd(), HWND_TOP, 0, 0, 0, 0, 556 SetWindowPos(hwnd(), HWND_TOP, 0, 0, 0, 0,
557 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); 557 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
558 } 558 }
559 559
560 void HWNDMessageHandler::Show() { 560 void HWNDMessageHandler::Show() {
561 if (IsWindow(hwnd())) 561 if (IsWindow(hwnd()))
562 ShowWindowWithState(ui::SHOW_STATE_INACTIVE); 562 ShowWindowWithState(ui::SHOW_STATE_NORMAL);
563 } 563 }
564 564
565 void HWNDMessageHandler::ShowWindowWithState(ui::WindowShowState show_state) { 565 void HWNDMessageHandler::ShowWindowWithState(ui::WindowShowState show_state) {
566 TRACE_EVENT0("views", "HWNDMessageHandler::ShowWindowWithState"); 566 TRACE_EVENT0("views", "HWNDMessageHandler::ShowWindowWithState");
567 DWORD native_show_state; 567 DWORD native_show_state;
568 switch (show_state) { 568 switch (show_state) {
569 case ui::SHOW_STATE_INACTIVE: 569 case ui::SHOW_STATE_INACTIVE:
570 native_show_state = SW_SHOWNOACTIVATE; 570 native_show_state = SW_SHOWNOACTIVATE;
571 break; 571 break;
572 case ui::SHOW_STATE_MAXIMIZED: 572 case ui::SHOW_STATE_MAXIMIZED:
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 SetMsgHandled(FALSE); 2241 SetMsgHandled(FALSE);
2242 } 2242 }
2243 2243
2244 void HWNDMessageHandler::HandleTouchEvents(const TouchEvents& touch_events) { 2244 void HWNDMessageHandler::HandleTouchEvents(const TouchEvents& touch_events) {
2245 base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr()); 2245 base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr());
2246 for (size_t i = 0; i < touch_events.size() && ref; ++i) 2246 for (size_t i = 0; i < touch_events.size() && ref; ++i)
2247 delegate_->HandleTouchEvent(touch_events[i]); 2247 delegate_->HandleTouchEvent(touch_events[i]);
2248 } 2248 }
2249 2249
2250 } // namespace views 2250 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698