| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/shell/renderer/test_runner/event_sender.h" | 5 #include "content/shell/renderer/test_runner/event_sender.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "content/public/common/page_zoom.h" | 10 #include "content/public/common/page_zoom.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 for (size_t i = 0; i < customItems.size(); ++i) { | 146 for (size_t i = 0; i < customItems.size(); ++i) { |
| 147 std::string prefixCopy = prefix; | 147 std::string prefixCopy = prefix; |
| 148 if (!customItems[i].enabled) | 148 if (!customItems[i].enabled) |
| 149 prefixCopy = kDisabledIdentifier + prefix; | 149 prefixCopy = kDisabledIdentifier + prefix; |
| 150 if (customItems[i].checked) | 150 if (customItems[i].checked) |
| 151 prefixCopy = kCheckedIdentifier + prefix; | 151 prefixCopy = kCheckedIdentifier + prefix; |
| 152 if (customItems[i].type == blink::WebMenuItemInfo::Separator) { | 152 if (customItems[i].type == blink::WebMenuItemInfo::Separator) { |
| 153 strings->push_back(prefixCopy + kSeparatorIdentifier); | 153 strings->push_back(prefixCopy + kSeparatorIdentifier); |
| 154 } else if (customItems[i].type == blink::WebMenuItemInfo::SubMenu) { | 154 } else if (customItems[i].type == blink::WebMenuItemInfo::SubMenu) { |
| 155 strings->push_back(prefixCopy + customItems[i].label.utf8() + | 155 strings->push_back(prefixCopy + customItems[i].label.utf8() + |
| 156 kSubMenuIdentifier); | 156 customItems[i].icon.utf8() + kSubMenuIdentifier); |
| 157 PopulateCustomItems(customItems[i].subMenuItems, prefixCopy + | 157 PopulateCustomItems(customItems[i].subMenuItems, prefixCopy + |
| 158 kSubMenuDepthIdentifier, strings); | 158 kSubMenuDepthIdentifier, strings); |
| 159 } else { | 159 } else { |
| 160 strings->push_back(prefixCopy + customItems[i].label.utf8()); | 160 strings->push_back(prefixCopy + customItems[i].label.utf8() + |
| 161 customItems[i].icon.utf8()); |
| 161 } | 162 } |
| 162 } | 163 } |
| 163 } | 164 } |
| 164 | 165 |
| 165 // Because actual context menu is implemented by the browser side, | 166 // Because actual context menu is implemented by the browser side, |
| 166 // this function does only what LayoutTests are expecting: | 167 // this function does only what LayoutTests are expecting: |
| 167 // - Many test checks the count of items. So returning non-zero value makes | 168 // - Many test checks the count of items. So returning non-zero value makes |
| 168 // sense. | 169 // sense. |
| 169 // - Some test compares the count before and after some action. So changing the | 170 // - Some test compares the count before and after some action. So changing the |
| 170 // count based on flags also makes sense. This function is doing such for some | 171 // count based on flags also makes sense. This function is doing such for some |
| (...skipping 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2352 | 2353 |
| 2353 bool EventSender::HandleInputEventOnViewOrPopup(const WebInputEvent& event) { | 2354 bool EventSender::HandleInputEventOnViewOrPopup(const WebInputEvent& event) { |
| 2354 if (WebPagePopup* popup = view_->pagePopup()) { | 2355 if (WebPagePopup* popup = view_->pagePopup()) { |
| 2355 if (!WebInputEvent::isKeyboardEventType(event.type)) | 2356 if (!WebInputEvent::isKeyboardEventType(event.type)) |
| 2356 return popup->handleInputEvent(event); | 2357 return popup->handleInputEvent(event); |
| 2357 } | 2358 } |
| 2358 return view_->handleInputEvent(event); | 2359 return view_->handleInputEvent(event); |
| 2359 } | 2360 } |
| 2360 | 2361 |
| 2361 } // namespace content | 2362 } // namespace content |
| OLD | NEW |