Commit a5fd318a authored by Collin Baker's avatar Collin Baker Committed by Commit Bot

Remove in_product_help namespace

Change-Id: Ib2200678698b6ed7c2a7cc22390ff3df58227add
Reviewed-on: https://chromium-review.googlesource.com/c/1313557
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604781}
parent 7cd7b168
...@@ -604,8 +604,7 @@ void NewTab(Browser* browser) { ...@@ -604,8 +604,7 @@ void NewTab(Browser* browser) {
#if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP) #if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP)
// Notify IPH that new tab was opened. // Notify IPH that new tab was opened.
auto* reopen_tab_iph = auto* reopen_tab_iph =
in_product_help::ReopenTabInProductHelpFactory::GetForProfile( ReopenTabInProductHelpFactory::GetForProfile(browser->profile());
browser->profile());
reopen_tab_iph->NewTabOpened(); reopen_tab_iph->NewTabOpened();
#endif #endif
......
...@@ -105,8 +105,7 @@ void RestoreTab(Browser* browser) { ...@@ -105,8 +105,7 @@ void RestoreTab(Browser* browser) {
base::RecordAction(base::UserMetricsAction("RestoreTab")); base::RecordAction(base::UserMetricsAction("RestoreTab"));
#if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP) #if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP)
auto* reopen_tab_iph = auto* reopen_tab_iph =
in_product_help::ReopenTabInProductHelpFactory::GetForProfile( ReopenTabInProductHelpFactory::GetForProfile(browser->profile());
browser->profile());
reopen_tab_iph->TabReopened(); reopen_tab_iph->TabReopened();
#endif #endif
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#include "base/time/tick_clock.h" #include "base/time/tick_clock.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/tabs/tab_strip_model.h"
namespace in_product_help {
ActiveTabTracker::ActiveTabTracker(const base::TickClock* clock, ActiveTabTracker::ActiveTabTracker(const base::TickClock* clock,
ActiveTabClosedCallback callback) ActiveTabClosedCallback callback)
: clock_(clock), active_tab_closed_callback_(std::move(callback)) { : clock_(clock), active_tab_closed_callback_(std::move(callback)) {
...@@ -62,5 +60,3 @@ void ActiveTabTracker::OnTabStripModelChanged( ...@@ -62,5 +60,3 @@ void ActiveTabTracker::OnTabStripModelChanged(
if (selection.active_tab_changed()) if (selection.active_tab_changed())
active_tab_changed_times_[model] = clock_->NowTicks(); active_tab_changed_times_[model] = clock_->NowTicks();
} }
} // namespace in_product_help
...@@ -17,8 +17,6 @@ class TickClock; ...@@ -17,8 +17,6 @@ class TickClock;
class TabStripModel; class TabStripModel;
namespace in_product_help {
// Tracks when tabs become active and notifies client when active tabs are // Tracks when tabs become active and notifies client when active tabs are
// closed. The client must register and unregister |TabStripModel|s and set a // closed. The client must register and unregister |TabStripModel|s and set a
// callback to be called when an active tab is closed. // callback to be called when an active tab is closed.
...@@ -57,6 +55,4 @@ class ActiveTabTracker : public TabStripModelObserver { ...@@ -57,6 +55,4 @@ class ActiveTabTracker : public TabStripModelObserver {
DISALLOW_COPY_AND_ASSIGN(ActiveTabTracker); DISALLOW_COPY_AND_ASSIGN(ActiveTabTracker);
}; };
} // namespace in_product_help
#endif // CHROME_BROWSER_UI_IN_PRODUCT_HELP_ACTIVE_TAB_TRACKER_H_ #endif // CHROME_BROWSER_UI_IN_PRODUCT_HELP_ACTIVE_TAB_TRACKER_H_
...@@ -38,8 +38,6 @@ constexpr base::TimeDelta kTimeStep = base::TimeDelta::FromSeconds(1); ...@@ -38,8 +38,6 @@ constexpr base::TimeDelta kTimeStep = base::TimeDelta::FromSeconds(1);
} // namespace } // namespace
namespace in_product_help {
class ActiveTabTrackerTest : public ::testing::Test { class ActiveTabTrackerTest : public ::testing::Test {
protected: protected:
void SetUp() override { void SetUp() override {
...@@ -194,5 +192,3 @@ TEST_F(ActiveTabTrackerTest, StopsObservingUponRemove) { ...@@ -194,5 +192,3 @@ TEST_F(ActiveTabTrackerTest, StopsObservingUponRemove) {
model.DetachWebContentsAt(0); model.DetachWebContentsAt(0);
} }
} // namespace in_product_help
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include "components/feature_engagement/public/feature_constants.h" #include "components/feature_engagement/public/feature_constants.h"
#include "components/feature_engagement/public/tracker.h" #include "components/feature_engagement/public/tracker.h"
namespace in_product_help {
ReopenTabInProductHelp::ReopenTabInProductHelp(Profile* profile, ReopenTabInProductHelp::ReopenTabInProductHelp(Profile* profile,
const base::TickClock* clock) const base::TickClock* clock)
: profile_(profile), : profile_(profile),
...@@ -82,5 +80,3 @@ void ReopenTabInProductHelp::OnBrowserRemoved(Browser* browser) { ...@@ -82,5 +80,3 @@ void ReopenTabInProductHelp::OnBrowserRemoved(Browser* browser) {
feature_engagement::Tracker* ReopenTabInProductHelp::GetTracker() { feature_engagement::Tracker* ReopenTabInProductHelp::GetTracker() {
return feature_engagement::TrackerFactory::GetForBrowserContext(profile_); return feature_engagement::TrackerFactory::GetForBrowserContext(profile_);
} }
} // namespace in_product_help
...@@ -25,8 +25,6 @@ class Tracker; ...@@ -25,8 +25,6 @@ class Tracker;
class TabStripModel; class TabStripModel;
namespace in_product_help {
// Listens for the triggering conditions for the reopen tab in-product help and // Listens for the triggering conditions for the reopen tab in-product help and
// starts the IPH flow at the appropriate time. This is a |Profile|-keyed // starts the IPH flow at the appropriate time. This is a |Profile|-keyed
// service since we track interactions per user profile. Hooks throughout the // service since we track interactions per user profile. Hooks throughout the
...@@ -72,6 +70,4 @@ class ReopenTabInProductHelp : public BrowserListObserver, public KeyedService { ...@@ -72,6 +70,4 @@ class ReopenTabInProductHelp : public BrowserListObserver, public KeyedService {
DISALLOW_COPY_AND_ASSIGN(ReopenTabInProductHelp); DISALLOW_COPY_AND_ASSIGN(ReopenTabInProductHelp);
}; };
} // namespace in_product_help
#endif // CHROME_BROWSER_UI_IN_PRODUCT_HELP_REOPEN_TAB_IN_PRODUCT_HELP_H_ #endif // CHROME_BROWSER_UI_IN_PRODUCT_HELP_REOPEN_TAB_IN_PRODUCT_HELP_H_
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#include "chrome/browser/ui/in_product_help/reopen_tab_in_product_help.h" #include "chrome/browser/ui/in_product_help/reopen_tab_in_product_help.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
namespace in_product_help {
ReopenTabInProductHelpFactory::ReopenTabInProductHelpFactory() ReopenTabInProductHelpFactory::ReopenTabInProductHelpFactory()
: BrowserContextKeyedServiceFactory( : BrowserContextKeyedServiceFactory(
"ReopenTabInProductHelp", "ReopenTabInProductHelp",
...@@ -47,5 +45,3 @@ content::BrowserContext* ReopenTabInProductHelpFactory::GetBrowserContextToUse( ...@@ -47,5 +45,3 @@ content::BrowserContext* ReopenTabInProductHelpFactory::GetBrowserContextToUse(
content::BrowserContext* context) const { content::BrowserContext* context) const {
return chrome::GetBrowserContextRedirectedInIncognito(context); return chrome::GetBrowserContextRedirectedInIncognito(context);
} }
} // namespace in_product_help
...@@ -19,8 +19,6 @@ namespace content { ...@@ -19,8 +19,6 @@ namespace content {
class BrowserContext; class BrowserContext;
} // namespace content } // namespace content
namespace in_product_help {
class ReopenTabInProductHelp; class ReopenTabInProductHelp;
class ReopenTabInProductHelpFactory : public BrowserContextKeyedServiceFactory { class ReopenTabInProductHelpFactory : public BrowserContextKeyedServiceFactory {
...@@ -44,6 +42,4 @@ class ReopenTabInProductHelpFactory : public BrowserContextKeyedServiceFactory { ...@@ -44,6 +42,4 @@ class ReopenTabInProductHelpFactory : public BrowserContextKeyedServiceFactory {
DISALLOW_COPY_AND_ASSIGN(ReopenTabInProductHelpFactory); DISALLOW_COPY_AND_ASSIGN(ReopenTabInProductHelpFactory);
}; };
} // namespace in_product_help
#endif // CHROME_BROWSER_UI_IN_PRODUCT_HELP_REOPEN_TAB_IN_PRODUCT_HELP_FACTORY_H_ #endif // CHROME_BROWSER_UI_IN_PRODUCT_HELP_REOPEN_TAB_IN_PRODUCT_HELP_FACTORY_H_
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
#include "components/feature_engagement/public/feature_constants.h" #include "components/feature_engagement/public/feature_constants.h"
#include "components/feature_engagement/public/tracker.h" #include "components/feature_engagement/public/tracker.h"
namespace in_product_help {
// static // static
const base::TimeDelta ReopenTabInProductHelpTrigger::kTabMinimumActiveDuration = const base::TimeDelta ReopenTabInProductHelpTrigger::kTabMinimumActiveDuration =
base::TimeDelta::FromSeconds(10); base::TimeDelta::FromSeconds(10);
...@@ -95,5 +93,3 @@ void ReopenTabInProductHelpTrigger::ResetTriggerState() { ...@@ -95,5 +93,3 @@ void ReopenTabInProductHelpTrigger::ResetTriggerState() {
time_of_last_step_ = base::TimeTicks(); time_of_last_step_ = base::TimeTicks();
trigger_state_ = NO_ACTIONS_SEEN; trigger_state_ = NO_ACTIONS_SEEN;
} }
} // namespace in_product_help
...@@ -12,8 +12,6 @@ namespace feature_engagement { ...@@ -12,8 +12,6 @@ namespace feature_engagement {
class Tracker; class Tracker;
} // namespace feature_engagement } // namespace feature_engagement
namespace in_product_help {
// Contains the triggering logic for the reopen closed tab IPH. Determines when // Contains the triggering logic for the reopen closed tab IPH. Determines when
// a user might have accidentally closed a tab based on user interactions // a user might have accidentally closed a tab based on user interactions
// reported to it. When this happens, this class asks the feature engagement // reported to it. When this happens, this class asks the feature engagement
...@@ -77,6 +75,4 @@ class ReopenTabInProductHelpTrigger { ...@@ -77,6 +75,4 @@ class ReopenTabInProductHelpTrigger {
DISALLOW_COPY_AND_ASSIGN(ReopenTabInProductHelpTrigger); DISALLOW_COPY_AND_ASSIGN(ReopenTabInProductHelpTrigger);
}; };
} // namespace in_product_help
#endif // CHROME_BROWSER_UI_IN_PRODUCT_HELP_REOPEN_TAB_IN_PRODUCT_HELP_TRIGGER_H_ #endif // CHROME_BROWSER_UI_IN_PRODUCT_HELP_REOPEN_TAB_IN_PRODUCT_HELP_TRIGGER_H_
...@@ -18,8 +18,6 @@ using ::testing::Return; ...@@ -18,8 +18,6 @@ using ::testing::Return;
using feature_engagement::test::MockTracker; using feature_engagement::test::MockTracker;
namespace in_product_help {
namespace { namespace {
void DismissImmediately(ReopenTabInProductHelpTrigger* trigger) { void DismissImmediately(ReopenTabInProductHelpTrigger* trigger) {
...@@ -156,5 +154,3 @@ TEST(ReopenTabInProductHelpTriggerTest, TriggersTwice) { ...@@ -156,5 +154,3 @@ TEST(ReopenTabInProductHelpTriggerTest, TriggersTwice) {
EXPECT_TRUE(triggered); EXPECT_TRUE(triggered);
} }
} // namespace in_product_help
...@@ -28,8 +28,6 @@ using ::testing::Return; ...@@ -28,8 +28,6 @@ using ::testing::Return;
using MockTracker = ::testing::NiceMock<feature_engagement::test::MockTracker>; using MockTracker = ::testing::NiceMock<feature_engagement::test::MockTracker>;
namespace in_product_help {
class ReopenTabInProductHelpTest : public BrowserWithTestWindowTest { class ReopenTabInProductHelpTest : public BrowserWithTestWindowTest {
protected: protected:
// We want to use |MockTracker| instead of |Tracker|, so we must override its // We want to use |MockTracker| instead of |Tracker|, so we must override its
...@@ -79,5 +77,3 @@ TEST_F(ReopenTabInProductHelpTest, TriggersIPH) { ...@@ -79,5 +77,3 @@ TEST_F(ReopenTabInProductHelpTest, TriggersIPH) {
reopen_tab_iph.NewTabOpened(); reopen_tab_iph.NewTabOpened();
reopen_tab_iph.OmniboxFocused(); reopen_tab_iph.OmniboxFocused();
} }
} // namespace in_product_help
...@@ -334,8 +334,7 @@ void RecentTabsSubMenuModel::ExecuteCommand(int command_id, int event_flags) { ...@@ -334,8 +334,7 @@ void RecentTabsSubMenuModel::ExecuteCommand(int command_id, int event_flags) {
#if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP) #if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP)
auto* reopen_tab_iph = auto* reopen_tab_iph =
in_product_help::ReopenTabInProductHelpFactory::GetForProfile( ReopenTabInProductHelpFactory::GetForProfile(browser_->profile());
browser_->profile());
reopen_tab_iph->TabReopened(); reopen_tab_iph->TabReopened();
#endif #endif
......
...@@ -1123,9 +1123,8 @@ void OmniboxViewViews::OnFocus() { ...@@ -1123,9 +1123,8 @@ void OmniboxViewViews::OnFocus() {
->OnOmniboxFocused(); ->OnOmniboxFocused();
} }
auto* reopen_tab_iph = auto* reopen_tab_iph = ReopenTabInProductHelpFactory::GetForProfile(
in_product_help::ReopenTabInProductHelpFactory::GetForProfile( location_bar_view_->profile());
location_bar_view_->profile());
reopen_tab_iph->OmniboxFocused(); reopen_tab_iph->OmniboxFocused();
} }
#endif #endif
......
...@@ -323,9 +323,8 @@ void BrowserTabStripController::CreateNewTab() { ...@@ -323,9 +323,8 @@ void BrowserTabStripController::CreateNewTab() {
// after NewTabOpened. TODO(collinbaker): remove omnibox focusing from // after NewTabOpened. TODO(collinbaker): remove omnibox focusing from
// triggering conditions (since it is always focused for new tabs) and move // triggering conditions (since it is always focused for new tabs) and move
// this after AddTabAt() call. // this after AddTabAt() call.
auto* reopen_tab_iph = auto* reopen_tab_iph = ReopenTabInProductHelpFactory::GetForProfile(
in_product_help::ReopenTabInProductHelpFactory::GetForProfile( browser_view_->browser()->profile());
browser_view_->browser()->profile());
reopen_tab_iph->NewTabOpened(); reopen_tab_iph->NewTabOpened();
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment