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

Side by Side Diff: views/view.cc

Issue 125148: Making FocusManager portable to toolkit_views (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « views/focus/focus_manager_win.cc ('k') | views/view_unittest.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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "views/view.h" 5 #include "views/view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #ifndef NDEBUG 8 #ifndef NDEBUG
9 #include <iostream> 9 #include <iostream>
10 #endif 10 #endif
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 } 257 }
258 258
259 bool View::IsFocusable() const { 259 bool View::IsFocusable() const {
260 return focusable_ && enabled_ && is_visible_; 260 return focusable_ && enabled_ && is_visible_;
261 } 261 }
262 262
263 void View::SetFocusable(bool focusable) { 263 void View::SetFocusable(bool focusable) {
264 focusable_ = focusable; 264 focusable_ = focusable;
265 } 265 }
266 266
267 FocusManager* View::GetFocusManager() {
268 Widget* widget = GetWidget();
269 return widget ? widget->GetFocusManager() : NULL;
270 }
271
267 bool View::HasFocus() { 272 bool View::HasFocus() {
268 FocusManager* focus_manager = GetFocusManager(); 273 FocusManager* focus_manager = GetFocusManager();
269 if (focus_manager) 274 if (focus_manager)
270 return focus_manager->GetFocusedView() == this; 275 return focus_manager->GetFocusedView() == this;
271 return false; 276 return false;
272 } 277 }
273 278
274 void View::SetHotTracked(bool flag) { 279 void View::SetHotTracked(bool flag) {
275 } 280 }
276 281
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 start_x = start_y = 0; 1397 start_x = start_y = 0;
1393 } 1398 }
1394 1399
1395 void View::DragInfo::PossibleDrag(int x, int y) { 1400 void View::DragInfo::PossibleDrag(int x, int y) {
1396 possible_drag = true; 1401 possible_drag = true;
1397 start_x = x; 1402 start_x = x;
1398 start_y = y; 1403 start_y = y;
1399 } 1404 }
1400 1405
1401 } // namespace 1406 } // namespace
OLDNEW
« no previous file with comments | « views/focus/focus_manager_win.cc ('k') | views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698