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

Unified Diff: ash/common/system/tray/system_tray_bubble.cc

Issue 2330403002: Do not activate system tray bubble by default (Closed)
Patch Set: Do not activate system tray bubble by default Created 4 years, 3 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 | « ash/common/system/tray/system_tray.cc ('k') | ash/common/system/tray/system_tray_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/system_tray_bubble.cc
diff --git a/ash/common/system/tray/system_tray_bubble.cc b/ash/common/system/tray/system_tray_bubble.cc
index a1eb75b0ad52c225b542b919865a0dde6f43edcb..6cbfb012c79a4c10b59e83b2d3605a1f7c1d7c02 100644
--- a/ash/common/system/tray/system_tray_bubble.cc
+++ b/ash/common/system/tray/system_tray_bubble.cc
@@ -213,8 +213,14 @@ void SystemTrayBubble::FocusDefaultIfNeeded() {
views::View* view =
manager->GetNextFocusableView(nullptr, nullptr, false, false);
- if (view)
+ // TODO(oshima): RequestFocus calls View::OnFocus even if the widget
+ // is not active (crbug.com/621791). Remove this check once the bug
+ // is fixed.
+ if (bubble_view_->GetWidget()->IsActive()) {
view->RequestFocus();
+ } else {
+ manager->SetStoredFocusView(view);
+ }
}
void SystemTrayBubble::DestroyItemViews() {
@@ -347,8 +353,10 @@ void SystemTrayBubble::CreateItemViews(LoginStatus login_status) {
}
}
- if (focus_view)
+ if (focus_view) {
+ tray_->ActivateBubble();
focus_view->RequestFocus();
+ }
}
} // namespace ash
« no previous file with comments | « ash/common/system/tray/system_tray.cc ('k') | ash/common/system/tray/system_tray_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698