| 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 "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 10 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" | 10 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "ui/base/dragdrop/os_exchange_data.h" | 26 #include "ui/base/dragdrop/os_exchange_data.h" |
| 27 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
| 28 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
| 29 #include "ui/base/window_open_disposition.h" | 29 #include "ui/base/window_open_disposition.h" |
| 30 #include "ui/views/controls/button/menu_button.h" | 30 #include "ui/views/controls/button/menu_button.h" |
| 31 #include "ui/views/controls/menu/menu_item_view.h" | 31 #include "ui/views/controls/menu/menu_item_view.h" |
| 32 #include "ui/views/controls/menu/submenu_view.h" | 32 #include "ui/views/controls/menu/submenu_view.h" |
| 33 #include "ui/views/widget/widget.h" | 33 #include "ui/views/widget/widget.h" |
| 34 | 34 |
| 35 using base::UserMetricsAction; | 35 using base::UserMetricsAction; |
| 36 using bookmarks::BookmarkNodeData; |
| 36 using content::PageNavigator; | 37 using content::PageNavigator; |
| 37 using views::MenuItemView; | 38 using views::MenuItemView; |
| 38 | 39 |
| 39 // Max width of a menu. There does not appear to be an OS value for this, yet | 40 // Max width of a menu. There does not appear to be an OS value for this, yet |
| 40 // both IE and FF restrict the max width of a menu. | 41 // both IE and FF restrict the max width of a menu. |
| 41 static const int kMaxMenuWidth = 400; | 42 static const int kMaxMenuWidth = 400; |
| 42 | 43 |
| 43 BookmarkMenuDelegate::BookmarkMenuDelegate(Browser* browser, | 44 BookmarkMenuDelegate::BookmarkMenuDelegate(Browser* browser, |
| 44 PageNavigator* navigator, | 45 PageNavigator* navigator, |
| 45 views::Widget* parent, | 46 views::Widget* parent, |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 BuildMenu(node, 0, submenu, next_menu_id); | 517 BuildMenu(node, 0, submenu, next_menu_id); |
| 517 } else { | 518 } else { |
| 518 NOTREACHED(); | 519 NOTREACHED(); |
| 519 } | 520 } |
| 520 } | 521 } |
| 521 } | 522 } |
| 522 | 523 |
| 523 bool BookmarkMenuDelegate::IsOutsideMenuIdRange(int menu_id) const { | 524 bool BookmarkMenuDelegate::IsOutsideMenuIdRange(int menu_id) const { |
| 524 return menu_id < min_menu_id_ || menu_id > max_menu_id_; | 525 return menu_id < min_menu_id_ || menu_id > max_menu_id_; |
| 525 } | 526 } |
| OLD | NEW |