Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5932)

Unified Diff: chrome/browser/chromeos/net/tether_notification_presenter.h

Issue 2861583002: [CrOS Tether] Open the Tether settings page when a tether notification body is clicked. (Closed)
Patch Set: stevenjb@ comments. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/net/tether_notification_presenter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/net/tether_notification_presenter.h
diff --git a/chrome/browser/chromeos/net/tether_notification_presenter.h b/chrome/browser/chromeos/net/tether_notification_presenter.h
index 1110452cbbae51dd4845ebf68779d1a638b178ce..b5fad9cb32c723a599dc735e6e81df073733c716 100644
--- a/chrome/browser/chromeos/net/tether_notification_presenter.h
+++ b/chrome/browser/chromeos/net/tether_notification_presenter.h
@@ -18,6 +18,8 @@
#include "ui/message_center/message_center_observer.h"
#include "ui/message_center/notification.h"
+class Profile;
+
namespace message_center {
class MessageCenter;
class Notification;
@@ -33,9 +35,10 @@ class TetherNotificationPresenter
: public NotificationPresenter,
public message_center::MessageCenterObserver {
public:
- // Caller must ensure that |message_center| amd |network_connect| outlive
- // this instance.
- TetherNotificationPresenter(message_center::MessageCenter* message_center,
+ // Caller must ensure that |profile|, |message_center|, and |network_connect|
+ // outlive this instance.
+ TetherNotificationPresenter(Profile* profile,
+ message_center::MessageCenter* message_center,
NetworkConnect* network_connect);
~TetherNotificationPresenter() override;
@@ -52,9 +55,17 @@ class TetherNotificationPresenter
void OnNotificationButtonClicked(const std::string& notification_id,
int button_index) override;
- private:
- friend class TetherNotificationPresenterTest;
+ class SettingsUiDelegate {
+ public:
+ virtual ~SettingsUiDelegate() {}
+ // Displays the settings page (opening a new window if necessary) at the
+ // provided subpage for the user with the Profile |profile|.
+ virtual void ShowSettingsSubPageForProfile(Profile* profile,
+ const std::string& sub_page) = 0;
+ };
+
+ private:
static const char kTetherNotifierId[];
static const char kPotentialHotspotNotificationId[];
static const char kActiveHostNotificationId[];
@@ -69,12 +80,20 @@ class TetherNotificationPresenter
const base::string16& message,
const message_center::RichNotificationData rich_notification_data);
+ friend class TetherNotificationPresenterTest;
+
+ void SetSettingsUiDelegateForTesting(
+ std::unique_ptr<SettingsUiDelegate> settings_ui_delegate);
+
void ShowNotification(
std::unique_ptr<message_center::Notification> notification);
+ Profile* profile_;
message_center::MessageCenter* message_center_;
NetworkConnect* network_connect_;
+ std::unique_ptr<SettingsUiDelegate> settings_ui_delegate_;
+
cryptauth::RemoteDevice hotspot_nearby_device_;
base::WeakPtrFactory<TetherNotificationPresenter> weak_ptr_factory_;
« no previous file with comments | « no previous file | chrome/browser/chromeos/net/tether_notification_presenter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698