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

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

Issue 297123002: API proposal for chrome.app.window to intercept all keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return if there is no windows with keyboard focus. Created 6 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
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 <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 widget->SetNativeWindowProperty("xx", widget); 648 widget->SetNativeWindowProperty("xx", widget);
649 widget->GetNativeWindowProperty("xx"); 649 widget->GetNativeWindowProperty("xx");
650 widget->GetFocusTraversable(); 650 widget->GetFocusTraversable();
651 widget->GetLayer(); 651 widget->GetLayer();
652 widget->ReorderNativeViews(); 652 widget->ReorderNativeViews();
653 widget->SetCapture(widget->GetRootView()); 653 widget->SetCapture(widget->GetRootView());
654 widget->ReleaseCapture(); 654 widget->ReleaseCapture();
655 widget->HasCapture(); 655 widget->HasCapture();
656 widget->GetWorkAreaBoundsInScreen(); 656 widget->GetWorkAreaBoundsInScreen();
657 widget->IsTranslucentWindowOpacitySupported(); 657 widget->IsTranslucentWindowOpacitySupported();
658 widget->SetInterceptAllKeys(true);
658 } 659 }
659 660
660 private: 661 private:
661 DISALLOW_COPY_AND_ASSIGN(WidgetWithDestroyedNativeViewTest); 662 DISALLOW_COPY_AND_ASSIGN(WidgetWithDestroyedNativeViewTest);
662 }; 663 };
663 664
664 TEST_F(WidgetWithDestroyedNativeViewTest, Test) { 665 TEST_F(WidgetWithDestroyedNativeViewTest, Test) {
665 { 666 {
666 Widget widget; 667 Widget widget;
667 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP); 668 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP);
(...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after
2728 EXPECT_EQ(3, view->GetEventCount(ui::ET_MOUSE_PRESSED)); 2729 EXPECT_EQ(3, view->GetEventCount(ui::ET_MOUSE_PRESSED));
2729 EXPECT_EQ(3, view->GetEventCount(ui::ET_MOUSE_RELEASED)); 2730 EXPECT_EQ(3, view->GetEventCount(ui::ET_MOUSE_RELEASED));
2730 EXPECT_EQ(1, view->GetEventCount(ui::ET_MOUSE_DRAGGED)); 2731 EXPECT_EQ(1, view->GetEventCount(ui::ET_MOUSE_DRAGGED));
2731 EXPECT_EQ(ui::EF_LEFT_MOUSE_BUTTON, view->last_flags()); 2732 EXPECT_EQ(ui::EF_LEFT_MOUSE_BUTTON, view->last_flags());
2732 2733
2733 widget->CloseNow(); 2734 widget->CloseNow();
2734 } 2735 }
2735 2736
2736 } // namespace test 2737 } // namespace test
2737 } // namespace views 2738 } // namespace views
OLDNEW
« ui/views/widget/desktop_aura/desktop_native_widget_aura.cc ('K') | « ui/views/widget/widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698