| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browser/ui/startup/startup_browser_creator_impl.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/ui/startup/startup_tab_provider.h" | 8 #include "chrome/browser/ui/startup/startup_tab_provider.h" |
| 9 #include "chrome/common/url_constants.cc" | 9 #include "chrome/common/url_constants.cc" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 return tabs; | 39 return tabs; |
| 40 } | 40 } |
| 41 | 41 |
| 42 StartupTabs GetResetTriggerTabs(Profile* profile) const override { | 42 StartupTabs GetResetTriggerTabs(Profile* profile) const override { |
| 43 StartupTabs tabs; | 43 StartupTabs tabs; |
| 44 if (options_ & kResetTriggerTabs) | 44 if (options_ & kResetTriggerTabs) |
| 45 tabs.emplace_back(GURL("https://reset-trigger"), false); | 45 tabs.emplace_back(GURL("https://reset-trigger"), false); |
| 46 return tabs; | 46 return tabs; |
| 47 } | 47 } |
| 48 | 48 |
| 49 StartupTabs GetPinnedTabs() const override { | 49 StartupTabs GetPinnedTabs(Profile* profile) const override { |
| 50 StartupTabs tabs; | 50 StartupTabs tabs; |
| 51 if (options_ & kPinnedTabs) | 51 if (options_ & kPinnedTabs) |
| 52 tabs.emplace_back(GURL("https://pinned"), true); | 52 tabs.emplace_back(GURL("https://pinned"), true); |
| 53 return tabs; | 53 return tabs; |
| 54 } | 54 } |
| 55 | 55 |
| 56 StartupTabs GetPreferencesTabs() const override { | 56 StartupTabs GetPreferencesTabs(const base::CommandLine& command_line_, |
| 57 Profile* profile) const override { |
| 57 StartupTabs tabs; | 58 StartupTabs tabs; |
| 58 if (options_ & kPreferencesTabs) | 59 if (options_ & kPreferencesTabs) |
| 59 tabs.emplace_back(GURL("https://prefs"), false); | 60 tabs.emplace_back(GURL("https://prefs"), false); |
| 60 return tabs; | 61 return tabs; |
| 61 } | 62 } |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 const uint32_t options_; | 65 const uint32_t options_; |
| 65 }; | 66 }; |
| 66 | 67 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 base::FilePath(), base::CommandLine(base::CommandLine::NO_PROGRAM), | 164 base::FilePath(), base::CommandLine(base::CommandLine::NO_PROGRAM), |
| 164 chrome::startup::IS_FIRST_RUN); | 165 chrome::startup::IS_FIRST_RUN); |
| 165 | 166 |
| 166 StartupTabs output = impl.DetermineStartupTabs(provider_allows_ntp, | 167 StartupTabs output = impl.DetermineStartupTabs(provider_allows_ntp, |
| 167 StartupTabs(), false, false); | 168 StartupTabs(), false, false); |
| 168 ASSERT_EQ(3U, output.size()); | 169 ASSERT_EQ(3U, output.size()); |
| 169 EXPECT_EQ("reset-trigger", output[0].url.host()); | 170 EXPECT_EQ("reset-trigger", output[0].url.host()); |
| 170 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), output[1].url); | 171 EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), output[1].url); |
| 171 EXPECT_EQ("pinned", output[2].url.host()); | 172 EXPECT_EQ("pinned", output[2].url.host()); |
| 172 } | 173 } |
| OLD | NEW |