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/browser_with_test_window_test.h" | 5 #include "chrome/test/base/browser_with_test_window_test.h" |
6 | 6 |
7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 #elif defined(TOOLKIT_VIEWS) | 110 #elif defined(TOOLKIT_VIEWS) |
111 return views_test_helper_->GetContext(); | 111 return views_test_helper_->GetContext(); |
112 #else | 112 #else |
113 return nullptr; | 113 return nullptr; |
114 #endif | 114 #endif |
115 } | 115 } |
116 | 116 |
117 void BrowserWithTestWindowTest::AddTab(Browser* browser, const GURL& url) { | 117 void BrowserWithTestWindowTest::AddTab(Browser* browser, const GURL& url) { |
118 chrome::NavigateParams params(browser, url, ui::PAGE_TRANSITION_TYPED); | 118 chrome::NavigateParams params(browser, url, ui::PAGE_TRANSITION_TYPED); |
119 params.tabstrip_index = 0; | 119 params.tabstrip_index = 0; |
120 params.disposition = NEW_FOREGROUND_TAB; | 120 params.disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; |
121 chrome::Navigate(¶ms); | 121 chrome::Navigate(¶ms); |
122 CommitPendingLoad(¶ms.target_contents->GetController()); | 122 CommitPendingLoad(¶ms.target_contents->GetController()); |
123 } | 123 } |
124 | 124 |
125 void BrowserWithTestWindowTest::CommitPendingLoad( | 125 void BrowserWithTestWindowTest::CommitPendingLoad( |
126 NavigationController* controller) { | 126 NavigationController* controller) { |
127 if (!controller->GetPendingEntry()) | 127 if (!controller->GetPendingEntry()) |
128 return; // Nothing to commit. | 128 return; // Nothing to commit. |
129 | 129 |
130 RenderFrameHost* old_rfh = controller->GetWebContents()->GetMainFrame(); | 130 RenderFrameHost* old_rfh = controller->GetWebContents()->GetMainFrame(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 Browser::CreateParams params(profile); | 229 Browser::CreateParams params(profile); |
230 if (hosted_app) { | 230 if (hosted_app) { |
231 params = Browser::CreateParams::CreateForApp( | 231 params = Browser::CreateParams::CreateForApp( |
232 "Test", true /* trusted_source */, gfx::Rect(), profile); | 232 "Test", true /* trusted_source */, gfx::Rect(), profile); |
233 } else { | 233 } else { |
234 params.type = browser_type; | 234 params.type = browser_type; |
235 } | 235 } |
236 params.window = browser_window; | 236 params.window = browser_window; |
237 return new Browser(params); | 237 return new Browser(params); |
238 } | 238 } |
OLD | NEW |