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

Side by Side Diff: chrome/browser/ui/views/constrained_window_views_browsertest.cc

Issue 14969012: components: Create web_modal component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-before-land Created 7 years, 7 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
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 "base/memory/weak_ptr.h" 5 #include "base/memory/weak_ptr.h"
6 #include "chrome/browser/platform_util.h" 6 #include "chrome/browser/platform_util.h"
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
11 #include "chrome/browser/ui/views/constrained_window_views.h" 11 #include "chrome/browser/ui/views/constrained_window_views.h"
12 #include "chrome/browser/ui/views/frame/browser_view.h" 12 #include "chrome/browser/ui/views/frame/browser_view.h"
13 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h"
14 #include "chrome/browser/ui/web_contents_modal_dialog_manager_delegate.h"
15 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" 13 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h"
16 #include "chrome/common/url_constants.h" 14 #include "chrome/common/url_constants.h"
17 #include "chrome/test/base/in_process_browser_test.h" 15 #include "chrome/test/base/in_process_browser_test.h"
18 #include "chrome/test/base/ui_test_utils.h" 16 #include "chrome/test/base/ui_test_utils.h"
17 #include "components/web_modal/web_contents_modal_dialog_manager.h"
18 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
19 #include "content/public/browser/native_web_keyboard_event.h" 19 #include "content/public/browser/native_web_keyboard_event.h"
20 #include "content/public/browser/render_view_host.h" 20 #include "content/public/browser/render_view_host.h"
21 #include "content/public/browser/web_contents.h" 21 #include "content/public/browser/web_contents.h"
22 #include "content/public/browser/web_contents_view.h" 22 #include "content/public/browser/web_contents_view.h"
23 #include "ipc/ipc_message.h" 23 #include "ipc/ipc_message.h"
24 #include "ui/base/accelerators/accelerator.h" 24 #include "ui/base/accelerators/accelerator.h"
25 #include "ui/views/controls/textfield/textfield.h" 25 #include "ui/views/controls/textfield/textfield.h"
26 #include "ui/views/focus/focus_manager.h" 26 #include "ui/views/focus/focus_manager.h"
27 #include "ui/views/layout/fill_layout.h" 27 #include "ui/views/layout/fill_layout.h"
28 #include "ui/views/test/test_widget_observer.h" 28 #include "ui/views/test/test_widget_observer.h"
29 #include "ui/views/window/dialog_delegate.h" 29 #include "ui/views/window/dialog_delegate.h"
30 #include "ui/web_dialogs/test/test_web_dialog_delegate.h" 30 #include "ui/web_dialogs/test/test_web_dialog_delegate.h"
31 31
32 #if defined(USE_AURA) && defined(USE_X11) 32 #if defined(USE_AURA) && defined(USE_X11)
33 #include <X11/Xlib.h> 33 #include <X11/Xlib.h>
34 #include "ui/base/x/x11_util.h" 34 #include "ui/base/x/x11_util.h"
35 #endif 35 #endif
36 36
37 using web_modal::WebContentsModalDialogManager;
38
37 namespace { 39 namespace {
38 40
39 class TestConstrainedDialogContentsView 41 class TestConstrainedDialogContentsView
40 : public views::View, 42 : public views::View,
41 public base::SupportsWeakPtr<TestConstrainedDialogContentsView> { 43 public base::SupportsWeakPtr<TestConstrainedDialogContentsView> {
42 public: 44 public:
43 TestConstrainedDialogContentsView() 45 TestConstrainedDialogContentsView()
44 : text_field_(new views::Textfield) { 46 : text_field_(new views::Textfield) {
45 SetLayoutManager(new views::FillLayout); 47 SetLayoutManager(new views::FillLayout);
46 AddChildView(text_field_); 48 AddChildView(text_field_);
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 // Escape is not processed as accelerator before it's sent to web contents. 378 // Escape is not processed as accelerator before it's sent to web contents.
377 EXPECT_FALSE(observer.widget_closed()); 379 EXPECT_FALSE(observer.widget_closed());
378 380
379 content::RunAllPendingInMessageLoop(); 381 content::RunAllPendingInMessageLoop();
380 382
381 // Escape is processed as accelerator after it's sent to web contents. 383 // Escape is processed as accelerator after it's sent to web contents.
382 EXPECT_TRUE(observer.widget_closed()); 384 EXPECT_TRUE(observer.widget_closed());
383 } 385 }
384 386
385 #endif // defined(OS_WIN) || (defined(USE_AURA) && defined(USE_X11)) 387 #endif // defined(OS_WIN) || (defined(USE_AURA) && defined(USE_X11))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698