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

Side by Side Diff: ui/views/controls/tree/tree_view.cc

Issue 108063004: Give up focus if the focused view becomes unfocusable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Extracted to common code into FocusManager class Created 7 years 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 "ui/views/controls/tree/tree_view.h" 5 #include "ui/views/controls/tree/tree_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 selected_node_(NULL), 73 selected_node_(NULL),
74 editing_(false), 74 editing_(false),
75 editor_(NULL), 75 editor_(NULL),
76 focus_manager_(NULL), 76 focus_manager_(NULL),
77 auto_expand_children_(false), 77 auto_expand_children_(false),
78 editable_(true), 78 editable_(true),
79 controller_(NULL), 79 controller_(NULL),
80 root_shown_(true), 80 root_shown_(true),
81 has_custom_icons_(false), 81 has_custom_icons_(false),
82 row_height_(font_.GetHeight() + kTextVerticalPadding * 2) { 82 row_height_(font_.GetHeight() + kTextVerticalPadding * 2) {
83 set_focusable(true); 83 SetFocusable(true);
84 closed_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed( 84 closed_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed(
85 (base::i18n::IsRTL() ? IDR_FOLDER_CLOSED_RTL 85 (base::i18n::IsRTL() ? IDR_FOLDER_CLOSED_RTL
86 : IDR_FOLDER_CLOSED)).ToImageSkia(); 86 : IDR_FOLDER_CLOSED)).ToImageSkia();
87 open_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed( 87 open_icon_ = *ui::ResourceBundle::GetSharedInstance().GetImageNamed(
88 (base::i18n::IsRTL() ? IDR_FOLDER_OPEN_RTL 88 (base::i18n::IsRTL() ? IDR_FOLDER_OPEN_RTL
89 : IDR_FOLDER_OPEN)).ToImageSkia(); 89 : IDR_FOLDER_OPEN)).ToImageSkia();
90 text_offset_ = closed_icon_.width() + kImagePadding + kImagePadding + 90 text_offset_ = closed_icon_.width() + kImagePadding + kImagePadding +
91 kArrowRegionSize; 91 kArrowRegionSize;
92 } 92 }
93 93
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 if (!is_expanded_) 1033 if (!is_expanded_)
1034 return max_width; 1034 return max_width;
1035 for (int i = 0; i < child_count(); ++i) { 1035 for (int i = 0; i < child_count(); ++i) {
1036 max_width = std::max(max_width, 1036 max_width = std::max(max_width,
1037 GetChild(i)->GetMaxWidth(indent, depth + 1)); 1037 GetChild(i)->GetMaxWidth(indent, depth + 1));
1038 } 1038 }
1039 return max_width; 1039 return max_width;
1040 } 1040 }
1041 1041
1042 } // namespace views 1042 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698