| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_UI_COCOA_VIEW_ID_UTIL_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_VIEW_ID_UTIL_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_VIEW_ID_UTIL_H_ | 6 #define CHROME_BROWSER_UI_COCOA_VIEW_ID_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| 11 #include "gfx/native_widget_types.h" | 11 #include "gfx/native_widget_types.h" |
| 12 #include "chrome/browser/view_ids.h" | 12 #include "chrome/browser/ui/view_ids.h" |
| 13 | 13 |
| 14 // ViewIDs are a system that indexes important views in the browser window by a | 14 // ViewIDs are a system that indexes important views in the browser window by a |
| 15 // ViewID identifier (integer). This is a useful compatibility for finding a | 15 // ViewID identifier (integer). This is a useful compatibility for finding a |
| 16 // view object in cross-platform tests. See BrowserFocusTest.* for an example | 16 // view object in cross-platform tests. See BrowserFocusTest.* for an example |
| 17 // of how ViewIDs are used. | 17 // of how ViewIDs are used. |
| 18 | 18 |
| 19 // For views with fixed ViewIDs, we add a -viewID method to them to return their | 19 // For views with fixed ViewIDs, we add a -viewID method to them to return their |
| 20 // ViewIDs directly. But for views with changeable ViewIDs, as NSView itself | 20 // ViewIDs directly. But for views with changeable ViewIDs, as NSView itself |
| 21 // doesn't provide a facility to store its ViewID, to avoid modifying each | 21 // doesn't provide a facility to store its ViewID, to avoid modifying each |
| 22 // individual classes for adding ViewID support, we use an internal map to store | 22 // individual classes for adding ViewID support, we use an internal map to store |
| (...skipping 20 matching lines...) Expand all Loading... |
| 43 @interface NSView (ViewID) | 43 @interface NSView (ViewID) |
| 44 | 44 |
| 45 // Returns the ViewID associated to the receiver. The default implementation | 45 // Returns the ViewID associated to the receiver. The default implementation |
| 46 // looks up the view's ViewID in the internal view to ViewID map. A subclass may | 46 // looks up the view's ViewID in the internal view to ViewID map. A subclass may |
| 47 // override this method to return its fixed ViewID. | 47 // override this method to return its fixed ViewID. |
| 48 - (ViewID)viewID; | 48 - (ViewID)viewID; |
| 49 | 49 |
| 50 @end | 50 @end |
| 51 | 51 |
| 52 #endif // CHROME_BROWSER_UI_COCOA_VIEW_ID_UTIL_H_ | 52 #endif // CHROME_BROWSER_UI_COCOA_VIEW_ID_UTIL_H_ |
| OLD | NEW |