Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ | 5 #ifndef CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ |
| 6 #define CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ | 6 #define CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 // Serialize this class as a DictionaryValue that can be converted to | 52 // Serialize this class as a DictionaryValue that can be converted to |
| 53 // a JavaScript object. | 53 // a JavaScript object. |
| 54 virtual void SerializeToDict(base::DictionaryValue* dict) const OVERRIDE; | 54 virtual void SerializeToDict(base::DictionaryValue* dict) const OVERRIDE; |
| 55 | 55 |
| 56 // Return the specific type of this control, which will be one of the | 56 // Return the specific type of this control, which will be one of the |
| 57 // string constants defined in extension_accessibility_api_constants.h. | 57 // string constants defined in extension_accessibility_api_constants.h. |
| 58 virtual const char* type() const = 0; | 58 virtual const char* type() const = 0; |
| 59 | 59 |
| 60 const std::string& name() const { return name_; } | 60 const std::string& name() const { return name_; } |
| 61 | 61 |
| 62 const std::string& context() const { return context_; } | |
| 63 void set_context(const std::string& context) { context_ = context; } | |
|
hashimoto
2011/12/07 23:07:35
Instead of exposing the setter, how about setting
dmazzoni
2011/12/07 23:34:12
Sure, I changed it to be in the constructor.
Now
hashimoto
2011/12/08 00:04:13
How about having two ctors (two argument version a
| |
| 64 | |
| 62 protected: | 65 protected: |
| 63 AccessibilityControlInfo(Profile* profile, const std::string& control_name); | 66 AccessibilityControlInfo(Profile* profile, const std::string& control_name); |
| 64 | 67 |
| 65 // The name of the control, like "OK" or "Password". | 68 // The name of the control, like "OK" or "Password". |
| 66 std::string name_; | 69 std::string name_; |
| 70 | |
| 71 // A string describing the context of the control, such as the name of | |
| 72 // the group or toolbar it's contained in. | |
| 73 std::string context_; | |
| 67 }; | 74 }; |
| 68 | 75 |
| 69 // Accessibility information about a window passed to onWindowOpened | 76 // Accessibility information about a window passed to onWindowOpened |
| 70 // and onWindowClosed event listeners. | 77 // and onWindowClosed event listeners. |
| 71 class AccessibilityWindowInfo : public AccessibilityControlInfo { | 78 class AccessibilityWindowInfo : public AccessibilityControlInfo { |
| 72 public: | 79 public: |
| 73 AccessibilityWindowInfo(Profile* profile, const std::string& window_name); | 80 AccessibilityWindowInfo(Profile* profile, const std::string& window_name); |
| 74 | 81 |
| 75 virtual const char* type() const OVERRIDE; | 82 virtual const char* type() const OVERRIDE; |
| 76 }; | 83 }; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 318 bool has_submenu() const { return has_submenu_; } | 325 bool has_submenu() const { return has_submenu_; } |
| 319 | 326 |
| 320 private: | 327 private: |
| 321 bool has_submenu_; | 328 bool has_submenu_; |
| 322 // The 0-based index of the current item and the number of total items. | 329 // The 0-based index of the current item and the number of total items. |
| 323 int item_index_; | 330 int item_index_; |
| 324 int item_count_; | 331 int item_count_; |
| 325 }; | 332 }; |
| 326 | 333 |
| 327 #endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ | 334 #endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EVENTS_H_ |
| OLD | NEW |