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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/test_browser_window_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/test_browser_window_aura.cc
diff --git a/chrome/test/base/test_browser_window_aura.cc b/chrome/test/base/test_browser_window_aura.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5b81a820e711cc6ebcfb3fc3b0ecd14e21c1a422
--- /dev/null
+++ b/chrome/test/base/test_browser_window_aura.cc
@@ -0,0 +1,55 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/test/base/test_browser_window_aura.h"
+
+namespace chrome {
+
+scoped_ptr<Browser> CreateBrowserWithAuraTestWindowForParams(
+ scoped_ptr<aura::Window> window,
+ Browser::CreateParams* params) {
+ if (window.get() == nullptr) {
+ window.reset(new aura::Window(nullptr));
+ window->set_id(0);
+ window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
+ window->Init(ui::LAYER_TEXTURED);
+ window->Show();
+ }
+
+ TestBrowserWindowAura* browser_window =
+ new TestBrowserWindowAura(window.Pass());
+ new TestBrowserWindowOwner(browser_window);
+ return browser_window->CreateBrowser(params);
+}
+
+} // namespace chrome
+
+TestBrowserWindowAura::TestBrowserWindowAura(
+ scoped_ptr<aura::Window> native_window)
+ : native_window_(native_window.Pass()) {}
+
+TestBrowserWindowAura::~TestBrowserWindowAura() {}
+
+gfx::NativeWindow TestBrowserWindowAura::GetNativeWindow() const {
+ return native_window_.get();
+}
+
+void TestBrowserWindowAura::Show() {
+ native_window_->Show();
+}
+
+void TestBrowserWindowAura::Hide() {
+ native_window_->Hide();
+}
+
+gfx::Rect TestBrowserWindowAura::GetBounds() const {
+ return native_window_->bounds();
+}
+
+scoped_ptr<Browser> TestBrowserWindowAura::CreateBrowser(
+ Browser::CreateParams* params) {
+ params->window = this;
+ browser_ = new Browser(*params);
+ return make_scoped_ptr(browser_);
+}
« 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