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

Unified Diff: components/mus/ws/focus_controller.cc

Issue 1868783003: Makes SetFocus() notify callback correctly on failure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « components/mus/ws/focus_controller.h ('k') | components/mus/ws/window_server.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/focus_controller.cc
diff --git a/components/mus/ws/focus_controller.cc b/components/mus/ws/focus_controller.cc
index 6985893b814fd69b3e695d605bc1e3c5e297c64f..5728acbe15455987b36c1dd15142cfae222c9ae4 100644
--- a/components/mus/ws/focus_controller.cc
+++ b/components/mus/ws/focus_controller.cc
@@ -71,11 +71,11 @@ FocusController::FocusController(FocusControllerDelegate* delegate,
FocusController::~FocusController() {
}
-void FocusController::SetFocusedWindow(ServerWindow* window) {
+bool FocusController::SetFocusedWindow(ServerWindow* window) {
if (GetFocusedWindow() == window)
- return;
+ return true;
- SetFocusedWindowImpl(FocusControllerChangeSource::EXPLICIT, window);
+ return SetFocusedWindowImpl(FocusControllerChangeSource::EXPLICIT, window);
}
ServerWindow* FocusController::GetFocusedWindow() {
@@ -207,11 +207,12 @@ ServerWindow* FocusController::GetActivatableAncestorOf(
return nullptr;
}
-void FocusController::SetFocusedWindowImpl(
+bool FocusController::SetFocusedWindowImpl(
FocusControllerChangeSource change_source,
ServerWindow* window) {
if (window && !CanBeFocused(window))
- return;
+ return false;
+
ServerWindow* old_focused = GetFocusedWindow();
DCHECK(!window || window->IsDrawn());
@@ -238,6 +239,7 @@ void FocusController::SetFocusedWindowImpl(
drawn_tracker_.reset(new ServerWindowDrawnTracker(track_window, this));
else
drawn_tracker_.reset();
+ return true;
}
void FocusController::OnDrawnStateWillChange(ServerWindow* ancestor,
« no previous file with comments | « components/mus/ws/focus_controller.h ('k') | components/mus/ws/window_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698