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 13 matching lines...) Expand all Loading... |
24 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
25 #include "ui/base/window_open_disposition.h" | 25 #include "ui/base/window_open_disposition.h" |
26 #include "ui/resources/grit/ui_resources.h" | 26 #include "ui/resources/grit/ui_resources.h" |
27 #include "ui/views/controls/button/menu_button.h" | 27 #include "ui/views/controls/button/menu_button.h" |
28 #include "ui/views/controls/menu/menu_item_view.h" | 28 #include "ui/views/controls/menu/menu_item_view.h" |
29 #include "ui/views/controls/menu/submenu_view.h" | 29 #include "ui/views/controls/menu/submenu_view.h" |
30 #include "ui/views/widget/widget.h" | 30 #include "ui/views/widget/widget.h" |
31 | 31 |
32 using base::UserMetricsAction; | 32 using base::UserMetricsAction; |
33 using bookmarks::BookmarkModel; | 33 using bookmarks::BookmarkModel; |
| 34 using bookmarks::BookmarkNode; |
34 using bookmarks::BookmarkNodeData; | 35 using bookmarks::BookmarkNodeData; |
35 using content::PageNavigator; | 36 using content::PageNavigator; |
36 using views::MenuItemView; | 37 using views::MenuItemView; |
37 | 38 |
38 // Max width of a menu. There does not appear to be an OS value for this, yet | 39 // Max width of a menu. There does not appear to be an OS value for this, yet |
39 // both IE and FF restrict the max width of a menu. | 40 // both IE and FF restrict the max width of a menu. |
40 static const int kMaxMenuWidth = 400; | 41 static const int kMaxMenuWidth = 400; |
41 | 42 |
42 BookmarkMenuDelegate::BookmarkMenuDelegate(Browser* browser, | 43 BookmarkMenuDelegate::BookmarkMenuDelegate(Browser* browser, |
43 PageNavigator* navigator, | 44 PageNavigator* navigator, |
(...skipping 472 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 |