| 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 #include "views/controls/menu/menu_win.h" | 5 #include "views/controls/menu/menu_win.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/keyboard_codes.h" | 9 #include "app/keyboard_codes.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.empty()) |
| 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::GetString(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 } |
| 415 | 415 |
| 416 MENUITEMINFO mii; | 416 MENUITEMINFO mii; |
| 417 mii.cbSize = sizeof(mii); | 417 mii.cbSize = sizeof(mii); |
| 418 mii.fMask = MIIM_FTYPE | MIIM_ID; | 418 mii.fMask = MIIM_FTYPE | MIIM_ID; |
| 419 if (submenu) { | 419 if (submenu) { |
| 420 mii.fMask |= MIIM_SUBMENU; | 420 mii.fMask |= MIIM_SUBMENU; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 break; | 566 break; |
| 567 | 567 |
| 568 default: | 568 default: |
| 569 NOTREACHED(); | 569 NOTREACHED(); |
| 570 return 0; | 570 return 0; |
| 571 } | 571 } |
| 572 return align_flags; | 572 return align_flags; |
| 573 } | 573 } |
| 574 | 574 |
| 575 } // namespace views | 575 } // namespace views |
| OLD | NEW |