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

Side by Side Diff: chrome/test/base/test_browser_window_aura.cc

Issue 1198313003: Fix the browser match rules. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address sky@'s comment. Created 5 years, 5 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/test/base/test_browser_window_aura.h ('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
(Empty)
1 // Copyright 2015 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 "chrome/test/base/test_browser_window_aura.h"
6
7 namespace chrome {
8
9 scoped_ptr<Browser> CreateBrowserWithAuraTestWindowForParams(
10 scoped_ptr<aura::Window> window,
11 Browser::CreateParams* params) {
12 if (window.get() == nullptr) {
13 window.reset(new aura::Window(nullptr));
14 window->set_id(0);
15 window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
16 window->Init(ui::LAYER_TEXTURED);
17 window->Show();
18 }
19
20 TestBrowserWindowAura* browser_window =
21 new TestBrowserWindowAura(window.Pass());
22 new TestBrowserWindowOwner(browser_window);
23 return browser_window->CreateBrowser(params);
24 }
25
26 } // namespace chrome
27
28 TestBrowserWindowAura::TestBrowserWindowAura(
29 scoped_ptr<aura::Window> native_window)
30 : native_window_(native_window.Pass()) {}
31
32 TestBrowserWindowAura::~TestBrowserWindowAura() {}
33
34 gfx::NativeWindow TestBrowserWindowAura::GetNativeWindow() const {
35 return native_window_.get();
36 }
37
38 void TestBrowserWindowAura::Show() {
39 native_window_->Show();
40 }
41
42 void TestBrowserWindowAura::Hide() {
43 native_window_->Hide();
44 }
45
46 gfx::Rect TestBrowserWindowAura::GetBounds() const {
47 return native_window_->bounds();
48 }
49
50 scoped_ptr<Browser> TestBrowserWindowAura::CreateBrowser(
51 Browser::CreateParams* params) {
52 params->window = this;
53 browser_ = new Browser(*params);
54 return make_scoped_ptr(browser_);
55 }
OLDNEW
« no previous file with comments | « chrome/test/base/test_browser_window_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698