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

Side by Side Diff: ash/test/ash_test_views_delegate.cc

Issue 280863002: Reduce creation of ViewsDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add widget includes for undef CreateWindow Created 6 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
« no previous file with comments | « ash/test/ash_test_views_delegate.h ('k') | ash/touch/touch_observer_hud_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 "ash/test/ash_test_views_delegate.h"
6
7 #include "ash/shell.h"
8 #include "content/public/test/web_contents_tester.h"
9
10 namespace ash {
11 namespace test {
12
13 AshTestViewsDelegate::AshTestViewsDelegate() {
14 }
15
16 AshTestViewsDelegate::~AshTestViewsDelegate() {
17 }
18
19 content::WebContents* AshTestViewsDelegate::CreateWebContents(
20 content::BrowserContext* browser_context,
21 content::SiteInstance* site_instance) {
22 return content::WebContentsTester::CreateTestWebContents(browser_context,
23 site_instance);
24 }
25
26 void AshTestViewsDelegate::OnBeforeWidgetInit(
27 views::Widget::InitParams* params,
28 views::internal::NativeWidgetDelegate* delegate) {
29 TestViewsDelegate::OnBeforeWidgetInit(params, delegate);
30
31 if (!params->parent && !params->context && ash::Shell::HasInstance()) {
32 // If the window has neither a parent nor a context add to the root.
33 params->parent = ash::Shell::GetInstance()->GetPrimaryRootWindow();
34 }
35 }
36
37 } // namespace test
38 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/ash_test_views_delegate.h ('k') | ash/touch/touch_observer_hud_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698