OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame/global_menu_bar_x11.h" | 5 #include "chrome/browser/ui/views/frame/global_menu_bar_x11.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <glib-object.h> | 8 #include <glib-object.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 const unsigned int kRecentlyClosedCount = 8; | 120 const unsigned int kRecentlyClosedCount = 8; |
121 | 121 |
122 // Menus more than this many chars long will get trimmed. | 122 // Menus more than this many chars long will get trimmed. |
123 const int kMaximumMenuWidthInChars = 50; | 123 const int kMaximumMenuWidthInChars = 50; |
124 | 124 |
125 // Constants used in menu definitions. | 125 // Constants used in menu definitions. |
126 const int MENU_SEPARATOR =-1; | 126 const int MENU_SEPARATOR =-1; |
127 const int MENU_END = -2; | 127 const int MENU_END = -2; |
128 const int MENU_DISABLED_ID = -3; | 128 const int MENU_DISABLED_ID = -3; |
129 | 129 |
130 // These tag values are used to refer to menu itesm. | 130 // These tag values are used to refer to menu items. |
131 const int TAG_NORMAL = 0; | |
132 const int TAG_MOST_VISITED = 1; | 131 const int TAG_MOST_VISITED = 1; |
133 const int TAG_RECENTLY_CLOSED = 2; | 132 const int TAG_RECENTLY_CLOSED = 2; |
134 const int TAG_MOST_VISITED_HEADER = 3; | 133 const int TAG_MOST_VISITED_HEADER = 3; |
135 const int TAG_RECENTLY_CLOSED_HEADER = 4; | 134 const int TAG_RECENTLY_CLOSED_HEADER = 4; |
136 | 135 |
137 GlobalMenuBarCommand file_menu[] = { | 136 GlobalMenuBarCommand file_menu[] = { |
138 { IDS_NEW_TAB, IDC_NEW_TAB }, | 137 { IDS_NEW_TAB, IDC_NEW_TAB }, |
139 { IDS_NEW_WINDOW, IDC_NEW_WINDOW }, | 138 { IDS_NEW_WINDOW, IDC_NEW_WINDOW }, |
140 { IDS_NEW_INCOGNITO_WINDOW, IDC_NEW_INCOGNITO_WINDOW }, | 139 { IDS_NEW_INCOGNITO_WINDOW, IDC_NEW_INCOGNITO_WINDOW }, |
141 { IDS_REOPEN_CLOSED_TABS_LINUX, IDC_RESTORE_TAB }, | 140 { IDS_REOPEN_CLOSED_TABS_LINUX, IDC_RESTORE_TAB }, |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 tab_restore_service_->LoadTabsFromLastSession(); | 776 tab_restore_service_->LoadTabsFromLastSession(); |
778 tab_restore_service_->AddObserver(this); | 777 tab_restore_service_->AddObserver(this); |
779 | 778 |
780 // If LoadTabsFromLastSession doesn't load tabs, it won't call | 779 // If LoadTabsFromLastSession doesn't load tabs, it won't call |
781 // TabRestoreServiceChanged(). This ensures that all new windows after | 780 // TabRestoreServiceChanged(). This ensures that all new windows after |
782 // the first one will have their menus populated correctly. | 781 // the first one will have their menus populated correctly. |
783 TabRestoreServiceChanged(tab_restore_service_); | 782 TabRestoreServiceChanged(tab_restore_service_); |
784 } | 783 } |
785 } | 784 } |
786 } | 785 } |
OLD | NEW |