OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "services/ui/ws/server_window.h" | 5 #include "services/ui/ws/server_window.h" |
6 | 6 |
7 #include <inttypes.h> | 7 #include <inttypes.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 OnWindowSharedPropertyChanged(this, name, value)); | 331 OnWindowSharedPropertyChanged(this, name, value)); |
332 } | 332 } |
333 | 333 |
334 std::string ServerWindow::GetName() const { | 334 std::string ServerWindow::GetName() const { |
335 auto it = properties_.find(mojom::WindowManager::kName_Property); | 335 auto it = properties_.find(mojom::WindowManager::kName_Property); |
336 if (it == properties_.end()) | 336 if (it == properties_.end()) |
337 return std::string(); | 337 return std::string(); |
338 return std::string(it->second.begin(), it->second.end()); | 338 return std::string(it->second.begin(), it->second.end()); |
339 } | 339 } |
340 | 340 |
| 341 bool ServerWindow::IsContainer() const { |
| 342 auto it = properties_.find(mojom::WindowManager::kContainer_Property); |
| 343 if (it == properties_.end()) |
| 344 return false; |
| 345 return true; |
| 346 } |
| 347 |
341 void ServerWindow::SetTextInputState(const ui::TextInputState& state) { | 348 void ServerWindow::SetTextInputState(const ui::TextInputState& state) { |
342 const bool changed = !(text_input_state_ == state); | 349 const bool changed = !(text_input_state_ == state); |
343 if (changed) { | 350 if (changed) { |
344 text_input_state_ = state; | 351 text_input_state_ = state; |
345 // keyboard even if the state is not changed. So we have to notify | 352 // keyboard even if the state is not changed. So we have to notify |
346 // |observers_|. | 353 // |observers_|. |
347 FOR_EACH_OBSERVER(ServerWindowObserver, observers_, | 354 FOR_EACH_OBSERVER(ServerWindowObserver, observers_, |
348 OnWindowTextInputStateChanged(this, state)); | 355 OnWindowTextInputStateChanged(this, state)); |
349 } | 356 } |
350 } | 357 } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 } | 469 } |
463 | 470 |
464 // static | 471 // static |
465 ServerWindow** ServerWindow::GetStackingTarget(ServerWindow* window) { | 472 ServerWindow** ServerWindow::GetStackingTarget(ServerWindow* window) { |
466 return &window->stacking_target_; | 473 return &window->stacking_target_; |
467 } | 474 } |
468 | 475 |
469 } // namespace ws | 476 } // namespace ws |
470 | 477 |
471 } // namespace ui | 478 } // namespace ui |
OLD | NEW |