| OLD | NEW |
| 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 "chrome/test/base/test_browser_window.h" | 5 #include "chrome/test/base/test_browser_window.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
| 10 #include "chrome/browser/ui/browser_list_observer.h" | 10 #include "chrome/browser/ui/browser_list_observer.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 12 | 12 |
| 13 | 13 |
| 14 // Helpers -------------------------------------------------------------------- | 14 // Helpers -------------------------------------------------------------------- |
| 15 | 15 |
| 16 namespace chrome { | 16 namespace chrome { |
| 17 | 17 |
| 18 std::unique_ptr<Browser> CreateBrowserWithTestWindowForParams( | 18 std::unique_ptr<Browser> CreateBrowserWithTestWindowForParams( |
| 19 Browser::CreateParams* params) { | 19 Browser::CreateParams* params) { |
| 20 TestBrowserWindow* window = new TestBrowserWindow; | 20 TestBrowserWindow* window = new TestBrowserWindow; |
| 21 new TestBrowserWindowOwner(window); | 21 new TestBrowserWindowOwner(window); |
| 22 params->window = window; | 22 params->window = window; |
| 23 return base::WrapUnique(new Browser(*params)); | 23 return base::MakeUnique<Browser>(*params); |
| 24 } | 24 } |
| 25 | 25 |
| 26 } // namespace chrome | 26 } // namespace chrome |
| 27 | 27 |
| 28 | 28 |
| 29 // TestBrowserWindow::TestLocationBar ----------------------------------------- | 29 // TestBrowserWindow::TestLocationBar ----------------------------------------- |
| 30 | 30 |
| 31 GURL TestBrowserWindow::TestLocationBar::GetDestinationURL() const { | 31 GURL TestBrowserWindow::TestLocationBar::GetDestinationURL() const { |
| 32 return GURL(); | 32 return GURL(); |
| 33 } | 33 } |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 } | 210 } |
| 211 | 211 |
| 212 TestBrowserWindowOwner::~TestBrowserWindowOwner() { | 212 TestBrowserWindowOwner::~TestBrowserWindowOwner() { |
| 213 BrowserList::RemoveObserver(this); | 213 BrowserList::RemoveObserver(this); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void TestBrowserWindowOwner::OnBrowserRemoved(Browser* browser) { | 216 void TestBrowserWindowOwner::OnBrowserRemoved(Browser* browser) { |
| 217 if (browser->window() == window_.get()) | 217 if (browser->window() == window_.get()) |
| 218 delete this; | 218 delete this; |
| 219 } | 219 } |
| OLD | NEW |