-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- ScalableIphDelegate is a class to handle IPH UIs and actions. Bug: b:284053005 Test: browser_tests --gtest_filter=*ScalableIphBrowserTest* Change-Id: I0784bd9b5257adf010160c053752650e44d5477c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4575995 Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Commit-Queue: Yuki Awano <yawano@google.com> Reviewed-by: Tao Wu <wutao@chromium.org> Cr-Commit-Position: refs/heads/main@{#1153595}
- Loading branch information
Yuki Awano
authored and
Chromium LUCI CQ
committed
Jun 6, 2023
1 parent
909adcb
commit b21f2b4
Showing
17 changed files
with
536 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
chrome/browser/ash/scalable_iph/mock_scalable_iph_delegate.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/ash/scalable_iph/mock_scalable_iph_delegate.h" | ||
|
||
namespace ash { | ||
namespace test { | ||
|
||
MockScalableIphDelegate::MockScalableIphDelegate() = default; | ||
MockScalableIphDelegate::~MockScalableIphDelegate() = default; | ||
|
||
} // namespace test | ||
} // namespace ash |
39 changes: 39 additions & 0 deletions
39
chrome/browser/ash/scalable_iph/mock_scalable_iph_delegate.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_ASH_SCALABLE_IPH_MOCK_SCALABLE_IPH_DELEGATE_H_ | ||
#define CHROME_BROWSER_ASH_SCALABLE_IPH_MOCK_SCALABLE_IPH_DELEGATE_H_ | ||
|
||
#include <memory> | ||
|
||
#include "chromeos/ash/components/scalable_iph/iph_session.h" | ||
#include "chromeos/ash/components/scalable_iph/scalable_iph_delegate.h" | ||
#include "components/keyed_service/core/keyed_service.h" | ||
#include "testing/gmock/include/gmock/gmock.h" | ||
|
||
namespace ash { | ||
namespace test { | ||
|
||
class MockScalableIphDelegate : public scalable_iph::ScalableIphDelegate { | ||
public: | ||
MockScalableIphDelegate(); | ||
~MockScalableIphDelegate() override; | ||
|
||
MOCK_METHOD(void, | ||
ShowBubble, | ||
(const scalable_iph::ScalableIphDelegate::BubbleParams& params, | ||
std::unique_ptr<scalable_iph::IphSession> iph_session), | ||
(override)); | ||
MOCK_METHOD( | ||
void, | ||
ShowNotification, | ||
(const scalable_iph::ScalableIphDelegate::NotificationParams& params, | ||
std::unique_ptr<scalable_iph::IphSession> iph_session), | ||
(override)); | ||
}; | ||
|
||
} // namespace test | ||
} // namespace ash | ||
|
||
#endif // CHROME_BROWSER_ASH_SCALABLE_IPH_MOCK_SCALABLE_IPH_DELEGATE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
chrome/browser/ash/scalable_iph/scalable_iph_delegate_impl.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/ash/scalable_iph/scalable_iph_delegate_impl.h" | ||
|
||
#include <memory> | ||
|
||
#include "chrome/browser/profiles/profile.h" | ||
#include "chromeos/ash/components/scalable_iph/iph_session.h" | ||
#include "chromeos/ash/components/scalable_iph/scalable_iph_delegate.h" | ||
|
||
namespace ash { | ||
|
||
ScalableIphDelegateImpl::ScalableIphDelegateImpl(Profile* profile) | ||
: profile_(profile) {} | ||
|
||
// Remember NOT to interact with `iph_session` from the destructor. See the | ||
// comment of `ScalableIphDelegate::ShowBubble` for details. | ||
ScalableIphDelegateImpl::~ScalableIphDelegateImpl() = default; | ||
|
||
void ScalableIphDelegateImpl::ShowBubble( | ||
const scalable_iph::ScalableIphDelegate::BubbleParams& params, | ||
std::unique_ptr<scalable_iph::IphSession> iph_session) { | ||
// TODO(b/284158855): Add implementation. | ||
} | ||
|
||
void ScalableIphDelegateImpl::ShowNotification( | ||
const scalable_iph::ScalableIphDelegate::NotificationParams& params, | ||
std::unique_ptr<scalable_iph::IphSession> iph_session) { | ||
// TODO(b/284158831): Add implementation. | ||
} | ||
|
||
} // namespace ash |
35 changes: 35 additions & 0 deletions
35
chrome/browser/ash/scalable_iph/scalable_iph_delegate_impl.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_ASH_SCALABLE_IPH_SCALABLE_IPH_DELEGATE_IMPL_H_ | ||
#define CHROME_BROWSER_ASH_SCALABLE_IPH_SCALABLE_IPH_DELEGATE_IMPL_H_ | ||
|
||
#include <memory> | ||
|
||
#include "chrome/browser/profiles/profile.h" | ||
#include "chromeos/ash/components/scalable_iph/iph_session.h" | ||
#include "chromeos/ash/components/scalable_iph/scalable_iph_delegate.h" | ||
#include "components/keyed_service/core/keyed_service.h" | ||
|
||
namespace ash { | ||
|
||
class ScalableIphDelegateImpl : public scalable_iph::ScalableIphDelegate { | ||
public: | ||
explicit ScalableIphDelegateImpl(Profile* profile); | ||
~ScalableIphDelegateImpl() override; | ||
|
||
// scalable_iph::ScalableIphDelegate: | ||
void ShowBubble( | ||
const BubbleParams& params, | ||
std::unique_ptr<scalable_iph::IphSession> iph_session) override; | ||
void ShowNotification( | ||
const NotificationParams& params, | ||
std::unique_ptr<scalable_iph::IphSession> iph_session) override; | ||
|
||
private: | ||
raw_ptr<Profile> profile_; | ||
}; | ||
} // namespace ash | ||
|
||
#endif // CHROME_BROWSER_ASH_SCALABLE_IPH_SCALABLE_IPH_DELEGATE_IMPL_H_ |
Oops, something went wrong.