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

Side by Side Diff: ash/wm/workspace_controller_unittest.cc

Issue 2502413005: Use aura::WindowProperty for title and name strings. (Closed)
Patch Set: Update comment Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « ash/wm/window_util.cc ('k') | chrome/browser/media/webrtc/desktop_media_list_ash.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/common/wm/workspace_controller.h" 5 #include "ash/common/wm/workspace_controller.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "ash/aura/wm_window_aura.h" 9 #include "ash/aura/wm_window_aura.h"
10 #include "ash/common/shelf/shelf_layout_manager.h" 10 #include "ash/common/shelf/shelf_layout_manager.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 namespace ash { 44 namespace ash {
45 45
46 // Returns a string containing the names of all the children of |window| (in 46 // Returns a string containing the names of all the children of |window| (in
47 // order). Each entry is separated by a space. 47 // order). Each entry is separated by a space.
48 std::string GetWindowNames(const aura::Window* window) { 48 std::string GetWindowNames(const aura::Window* window) {
49 std::string result; 49 std::string result;
50 for (size_t i = 0; i < window->children().size(); ++i) { 50 for (size_t i = 0; i < window->children().size(); ++i) {
51 if (i != 0) 51 if (i != 0)
52 result += " "; 52 result += " ";
53 result += window->children()[i]->name(); 53 result += window->children()[i]->GetName();
54 } 54 }
55 return result; 55 return result;
56 } 56 }
57 57
58 // Returns a string containing the names of windows corresponding to each of the 58 // Returns a string containing the names of windows corresponding to each of the
59 // child layers of |window|'s layer. Any layers that don't correspond to a child 59 // child layers of |window|'s layer. Any layers that don't correspond to a child
60 // Window of |window| are ignored. The result is ordered based on the layer 60 // Window of |window| are ignored. The result is ordered based on the layer
61 // ordering. 61 // ordering.
62 std::string GetLayerNames(const aura::Window* window) { 62 std::string GetLayerNames(const aura::Window* window) {
63 typedef std::map<const ui::Layer*, std::string> LayerToWindowNameMap; 63 typedef std::map<const ui::Layer*, std::string> LayerToWindowNameMap;
64 LayerToWindowNameMap window_names; 64 LayerToWindowNameMap window_names;
65 for (size_t i = 0; i < window->children().size(); ++i) { 65 for (size_t i = 0; i < window->children().size(); ++i) {
66 window_names[window->children()[i]->layer()] = 66 window_names[window->children()[i]->layer()] =
67 window->children()[i]->name(); 67 window->children()[i]->GetName();
68 } 68 }
69 69
70 std::string result; 70 std::string result;
71 const std::vector<ui::Layer*>& layers(window->layer()->children()); 71 const std::vector<ui::Layer*>& layers(window->layer()->children());
72 for (size_t i = 0; i < layers.size(); ++i) { 72 for (size_t i = 0; i < layers.size(); ++i) {
73 LayerToWindowNameMap::iterator layer_i = window_names.find(layers[i]); 73 LayerToWindowNameMap::iterator layer_i = window_names.find(layers[i]);
74 if (layer_i != window_names.end()) { 74 if (layer_i != window_names.end()) {
75 if (!result.empty()) 75 if (!result.empty())
76 result += " "; 76 result += " ";
77 result += layer_i->second; 77 result += layer_i->second;
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 ui::EventTimeForNow()); 1605 ui::EventTimeForNow());
1606 target = targeter->FindTargetForEvent(root, &touch); 1606 target = targeter->FindTargetForEvent(root, &touch);
1607 if (points[i].is_target_hit) 1607 if (points[i].is_target_hit)
1608 EXPECT_EQ(window.get(), target); 1608 EXPECT_EQ(window.get(), target);
1609 else 1609 else
1610 EXPECT_NE(window.get(), target); 1610 EXPECT_NE(window.get(), target);
1611 } 1611 }
1612 } 1612 }
1613 1613
1614 } // namespace ash 1614 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_util.cc ('k') | chrome/browser/media/webrtc/desktop_media_list_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698