| OLD | NEW |
| 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/menu/menu_win.h" | 5 #include "ui/views/controls/menu/menu_win.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 } | 394 } |
| 395 | 395 |
| 396 void MenuWin::AddMenuItemInternal(int index, | 396 void MenuWin::AddMenuItemInternal(int index, |
| 397 int item_id, | 397 int item_id, |
| 398 const string16& label, | 398 const string16& label, |
| 399 const gfx::ImageSkia& icon, | 399 const gfx::ImageSkia& icon, |
| 400 HMENU submenu, | 400 HMENU submenu, |
| 401 MenuItemType type) { | 401 MenuItemType type) { |
| 402 DCHECK(type != SEPARATOR) << "Call AddSeparator instead!"; | 402 DCHECK(type != SEPARATOR) << "Call AddSeparator instead!"; |
| 403 | 403 |
| 404 if (!owner_draw_ && !icon.empty()) | 404 if (!owner_draw_ && !icon.isNull()) |
| 405 owner_draw_ = true; | 405 owner_draw_ = true; |
| 406 | 406 |
| 407 if (label.empty() && !delegate()) { | 407 if (label.empty() && !delegate()) { |
| 408 // No label and no delegate; don't add an empty menu. | 408 // No label and no delegate; don't add an empty menu. |
| 409 // It appears under some circumstance we're getting an empty label | 409 // It appears under some circumstance we're getting an empty label |
| 410 // (l10n_util::GetStringUTF16(IDS_TASK_MANAGER) returns ""). This shouldn't | 410 // (l10n_util::GetStringUTF16(IDS_TASK_MANAGER) returns ""). This shouldn't |
| 411 // happen, but I'm working over the crash here. | 411 // happen, but I'm working over the crash here. |
| 412 NOTREACHED(); | 412 NOTREACHED(); |
| 413 return; | 413 return; |
| 414 } | 414 } |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 break; | 565 break; |
| 566 | 566 |
| 567 default: | 567 default: |
| 568 NOTREACHED(); | 568 NOTREACHED(); |
| 569 return 0; | 569 return 0; |
| 570 } | 570 } |
| 571 return align_flags; | 571 return align_flags; |
| 572 } | 572 } |
| 573 | 573 |
| 574 } // namespace views | 574 } // namespace views |
| OLD | NEW |