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

Side by Side Diff: ui/oak/oak_tree_model.cc

Issue 173183002: Remove oak windows and its flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove one more oak.gyp reference Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/oak/oak_tree_model.h ('k') | ui/oak/oak_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/oak/oak_tree_model.h"
6
7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/aura/root_window.h"
9 #include "ui/aura/window.h"
10 #include "ui/base/models/tree_node_model.h"
11
12 namespace oak {
13 namespace internal {
14
15 base::string16 GetNodeTitleForWindow(aura::Window* window) {
16 std::string window_name = window->name();
17 if (window_name.empty())
18 window_name.append("Unnamed window");
19 return base::ASCIIToUTF16(window_name);
20 }
21
22 void AddChildWindows(aura::Window* parent_window, WindowNode* parent_node) {
23 aura::Window::Windows::const_iterator it = parent_window->children().begin();
24 for (; it != parent_window->children().end(); ++it) {
25 WindowNode* child_node = new WindowNode(GetNodeTitleForWindow(*it), *it);
26 parent_node->Add(child_node, parent_node->child_count());
27 AddChildWindows(*it, child_node);
28 }
29 }
30
31 TreeOfWindows* GenerateModel(aura::Window* root) {
32 WindowNode* root_node = new WindowNode(GetNodeTitleForWindow(root), root);
33 TreeOfWindows* tree = new TreeOfWindows(root_node);
34 AddChildWindows(root, root_node);
35 return tree;
36 }
37
38 } // namespace internal
39 } // namespace oak
OLDNEW
« no previous file with comments | « ui/oak/oak_tree_model.h ('k') | ui/oak/oak_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698