| 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/native_menu_win.h" | 5 #include "ui/views/controls/menu/native_menu_win.h" |
| 6 | 6 |
| 7 #include <Windowsx.h> | 7 #include <Windowsx.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 NativeMenuWin::NativeMenuWin(ui::MenuModel* model, HWND system_menu_for) | 393 NativeMenuWin::NativeMenuWin(ui::MenuModel* model, HWND system_menu_for) |
| 394 : model_(model), | 394 : model_(model), |
| 395 menu_(NULL), | 395 menu_(NULL), |
| 396 owner_draw_(l10n_util::NeedOverrideDefaultUIFont(NULL, NULL) && | 396 owner_draw_(l10n_util::NeedOverrideDefaultUIFont(NULL, NULL) && |
| 397 !system_menu_for), | 397 !system_menu_for), |
| 398 system_menu_for_(system_menu_for), | 398 system_menu_for_(system_menu_for), |
| 399 first_item_index_(0), | 399 first_item_index_(0), |
| 400 menu_action_(MENU_ACTION_NONE), | 400 menu_action_(MENU_ACTION_NONE), |
| 401 menu_to_select_(NULL), | 401 menu_to_select_(NULL), |
| 402 position_to_select_(-1), | 402 position_to_select_(-1), |
| 403 menu_to_select_factory_(this), | |
| 404 parent_(NULL), | 403 parent_(NULL), |
| 405 destroyed_flag_(NULL) { | 404 destroyed_flag_(NULL), |
| 405 menu_to_select_factory_(this) { |
| 406 } | 406 } |
| 407 | 407 |
| 408 NativeMenuWin::~NativeMenuWin() { | 408 NativeMenuWin::~NativeMenuWin() { |
| 409 if (destroyed_flag_) | 409 if (destroyed_flag_) |
| 410 *destroyed_flag_ = true; | 410 *destroyed_flag_ = true; |
| 411 STLDeleteContainerPointers(items_.begin(), items_.end()); | 411 STLDeleteContainerPointers(items_.begin(), items_.end()); |
| 412 DestroyMenu(menu_); | 412 DestroyMenu(menu_); |
| 413 } | 413 } |
| 414 | 414 |
| 415 //////////////////////////////////////////////////////////////////////////////// | 415 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 | 756 |
| 757 //////////////////////////////////////////////////////////////////////////////// | 757 //////////////////////////////////////////////////////////////////////////////// |
| 758 // MenuWrapper, public: | 758 // MenuWrapper, public: |
| 759 | 759 |
| 760 // static | 760 // static |
| 761 MenuWrapper* MenuWrapper::CreateWrapper(ui::MenuModel* model) { | 761 MenuWrapper* MenuWrapper::CreateWrapper(ui::MenuModel* model) { |
| 762 return new NativeMenuWin(model, NULL); | 762 return new NativeMenuWin(model, NULL); |
| 763 } | 763 } |
| 764 | 764 |
| 765 } // namespace views | 765 } // namespace views |
| OLD | NEW |