Commit 9db99f13 authored by Petr Smirnov's avatar Petr Smirnov Committed by Commit Bot

Public methods for showing network detailed view bubble

Add public ash methods for showing network detailed view bubble.

Rationale: we are creating new UpdateRequiredScreen
on the sign-in screen, which contains a button for network selection.
Click on this button should open the bubble with the list of networks.

Bug: 1005151
Change-Id: I6a4acebcc700f7b400275598978f67ccc90d4d6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1807232Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Reviewed-by: default avatarIvan Šandrk <isandrk@chromium.org>
Commit-Queue: Petr Smirnov <petrsmirnov@google.com>
Cr-Commit-Position: refs/heads/master@{#699957}
parent 38bfb155
......@@ -96,6 +96,11 @@ class ASH_PUBLIC_EXPORT SystemTray {
// Shows the volume slider bubble shown at the right bottom of screen.
virtual void ShowVolumeSliderBubble() = 0;
// Shows the network detailed view bubble at the right bottom of the primary
// display. Set |show_by_click| to true if bubble is shown by mouse or gesture
// click (it is used e.g. for timing histograms).
virtual void ShowNetworkDetailedViewBubble(bool show_by_click) = 0;
protected:
SystemTray();
virtual ~SystemTray();
......
......@@ -107,4 +107,13 @@ void SystemTrayModel::ShowVolumeSliderBubble() {
}
}
void SystemTrayModel::ShowNetworkDetailedViewBubble(bool show_by_click) {
// Show the bubble on the primary display.
UnifiedSystemTray* system_tray = Shell::GetPrimaryRootWindowController()
->GetStatusAreaWidget()
->unified_system_tray();
if (system_tray)
system_tray->ShowNetworkDetailedViewBubble(show_by_click);
}
} // namespace ash
......@@ -49,6 +49,7 @@ class SystemTrayModel : public SystemTray {
const base::string16& notification_body) override;
void SetUpdateOverCellularAvailableIconVisible(bool visible) override;
void ShowVolumeSliderBubble() override;
void ShowNetworkDetailedViewBubble(bool show_by_click) override;
ClockModel* clock() { return clock_.get(); }
EnterpriseDomainModel* enterprise_domain() {
......
......@@ -208,6 +208,11 @@ void UnifiedSystemTray::ShowAudioDetailedViewBubble() {
bubble_->ShowAudioDetailedView();
}
void UnifiedSystemTray::ShowNetworkDetailedViewBubble(bool show_by_click) {
ShowBubble(show_by_click);
bubble_->ShowNetworkDetailedView(true /* force */);
}
void UnifiedSystemTray::SetTrayBubbleHeight(int height) {
ui_delegate_->SetTrayBubbleHeight(height);
}
......
......@@ -78,6 +78,9 @@ class ASH_EXPORT UnifiedSystemTray : public TrayBackgroundView,
// Shows main bubble with audio settings detailed view.
void ShowAudioDetailedViewBubble();
// Shows main bubble with network settings detailed view.
void ShowNetworkDetailedViewBubble(bool show_by_click);
// Return the bounds of the bubble in the screen.
gfx::Rect GetBubbleBoundsInScreen() const;
......
......@@ -183,6 +183,15 @@ void UnifiedSystemTrayBubble::ShowAudioDetailedView() {
controller_->ShowAudioDetailedView();
}
void UnifiedSystemTrayBubble::ShowNetworkDetailedView(bool force) {
if (!bubble_widget_)
return;
DCHECK(unified_view_);
DCHECK(controller_);
controller_->ShowNetworkDetailedView(force);
}
void UnifiedSystemTrayBubble::UpdateBubble() {
if (!bubble_widget_)
return;
......
......@@ -67,6 +67,9 @@ class ASH_EXPORT UnifiedSystemTrayBubble
// Show audio settings detailed view.
void ShowAudioDetailedView();
// Show network settings detailed view.
void ShowNetworkDetailedView(bool force);
// Update bubble bounds and focus if necessary.
void UpdateBubble();
......
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