| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gtk/global_history_menu.h" | 5 #include "chrome/browser/ui/gtk/global_history_menu.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "content/common/notification_service.h" | 25 #include "content/common/notification_service.h" |
| 26 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
| 27 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
| 28 #include "ui/base/text/text_elider.h" | 28 #include "ui/base/text/text_elider.h" |
| 29 #include "ui/gfx/codec/png_codec.h" | 29 #include "ui/gfx/codec/png_codec.h" |
| 30 #include "ui/gfx/gtk_util.h" | 30 #include "ui/gfx/gtk_util.h" |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 // The maximum number of most visited items to display. | 34 // The maximum number of most visited items to display. |
| 35 const unsigned int kMostVisitedCount = 12; | 35 const unsigned int kMostVisitedCount = 8; |
| 36 | 36 |
| 37 // The number of recently closed items to get. | 37 // The number of recently closed items to get. |
| 38 const unsigned int kRecentlyClosedCount = 10; | 38 const unsigned int kRecentlyClosedCount = 8; |
| 39 | 39 |
| 40 // Menus more than this many chars long will get trimmed. | 40 // Menus more than this many chars long will get trimmed. |
| 41 const int kMaximumMenuWidthInChars = 50; | 41 const int kMaximumMenuWidthInChars = 50; |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| 45 struct GlobalHistoryMenu::ClearMenuClosure { | 45 struct GlobalHistoryMenu::ClearMenuClosure { |
| 46 GtkWidget* container; | 46 GtkWidget* container; |
| 47 GlobalHistoryMenu* menu_bar; | 47 GlobalHistoryMenu* menu_bar; |
| 48 int tag; | 48 int tag; |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 tab_restore_service_->LoadTabsFromLastSession(); | 527 tab_restore_service_->LoadTabsFromLastSession(); |
| 528 tab_restore_service_->AddObserver(this); | 528 tab_restore_service_->AddObserver(this); |
| 529 | 529 |
| 530 // If LoadTabsFromLastSession doesn't load tabs, it won't call | 530 // If LoadTabsFromLastSession doesn't load tabs, it won't call |
| 531 // TabRestoreServiceChanged(). This ensures that all new windows after | 531 // TabRestoreServiceChanged(). This ensures that all new windows after |
| 532 // the first one will have their menus populated correctly. | 532 // the first one will have their menus populated correctly. |
| 533 TabRestoreServiceChanged(tab_restore_service_); | 533 TabRestoreServiceChanged(tab_restore_service_); |
| 534 } | 534 } |
| 535 } | 535 } |
| 536 } | 536 } |
| OLD | NEW |