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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // Create a Browser (with associated window) on the specified profile. | 175 // Create a Browser (with associated window) on the specified profile. |
176 Browser* CreateBrowserOnProfile(Profile* profile, | 176 Browser* CreateBrowserOnProfile(Profile* profile, |
177 chrome::HostDesktopType host_desktop_type) { | 177 chrome::HostDesktopType host_desktop_type) { |
178 Browser* new_browser = | 178 Browser* new_browser = |
179 new Browser(Browser::CreateParams(profile, host_desktop_type)); | 179 new Browser(Browser::CreateParams(profile, host_desktop_type)); |
180 chrome::AddSelectedTabWithURL(new_browser, | 180 chrome::AddSelectedTabWithURL(new_browser, |
181 GURL(url::kAboutBlankURL), | 181 GURL(url::kAboutBlankURL), |
182 ui::PAGE_TRANSITION_AUTO_TOPLEVEL); | 182 ui::PAGE_TRANSITION_AUTO_TOPLEVEL); |
183 content::WaitForLoadStop( | 183 content::WaitForLoadStop( |
184 new_browser->tab_strip_model()->GetActiveWebContents()); | 184 new_browser->tab_strip_model()->GetActiveWebContents()); |
185 new_browser->window()->Show(); | 185 new_browser->window()->Show(false /* user_gesture */); |
186 return new_browser; | 186 return new_browser; |
187 } | 187 } |
188 | 188 |
189 // Adjust the number of browsers and associated windows up or down | 189 // Adjust the number of browsers and associated windows up or down |
190 // to |num_windows|. This routine assumes that there is only a single | 190 // to |num_windows|. This routine assumes that there is only a single |
191 // browser associated with the profile on entry. |*base_browser| contains | 191 // browser associated with the profile on entry. |*base_browser| contains |
192 // this browser, and the profile is derived from that browser. On output, | 192 // this browser, and the profile is derived from that browser. On output, |
193 // if |*base_browser| was destroyed (because |num_windows == 0|), NULL | 193 // if |*base_browser| was destroyed (because |num_windows == 0|), NULL |
194 // is assigned to that memory location. | 194 // is assigned to that memory location. |
195 bool AdjustBrowsersOnProfile(Browser** base_browser, int num_windows) { | 195 bool AdjustBrowsersOnProfile(Browser** base_browser, int num_windows) { |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 } | 560 } |
561 } | 561 } |
562 | 562 |
563 IN_PROC_BROWSER_TEST_F(BrowserCloseTest, MAYBE_DownloadsCloseCheck_5) { | 563 IN_PROC_BROWSER_TEST_F(BrowserCloseTest, MAYBE_DownloadsCloseCheck_5) { |
564 ASSERT_TRUE(SetupForDownloadCloseCheck()); | 564 ASSERT_TRUE(SetupForDownloadCloseCheck()); |
565 for (size_t i = 5 * arraysize(download_close_check_cases) / 6; | 565 for (size_t i = 5 * arraysize(download_close_check_cases) / 6; |
566 i < 6 * arraysize(download_close_check_cases) / 6; ++i) { | 566 i < 6 * arraysize(download_close_check_cases) / 6; ++i) { |
567 ExecuteDownloadCloseCheckCase(i); | 567 ExecuteDownloadCloseCheckCase(i); |
568 } | 568 } |
569 } | 569 } |
OLD | NEW |