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.h" | 9 #include "base/stl_util.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/history/top_sites.h" | 12 #include "chrome/browser/history/top_sites.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/sessions/tab_restore_service.h" | 14 #include "chrome/browser/sessions/tab_restore_service.h" |
15 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 15 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
16 #include "chrome/browser/themes/theme_service_factory.h" | 16 #include "chrome/browser/themes/theme_service_factory.h" |
17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 18 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
19 #include "chrome/browser/ui/gtk/global_menu_bar.h" | 19 #include "chrome/browser/ui/gtk/global_menu_bar.h" |
20 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 20 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
21 #include "chrome/browser/ui/gtk/gtk_util.h" | 21 #include "chrome/browser/ui/gtk/gtk_util.h" |
22 #include "chrome/browser/ui/gtk/owned_widget_gtk.h" | |
23 #include "chrome/common/chrome_notification_types.h" | 22 #include "chrome/common/chrome_notification_types.h" |
24 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
25 #include "content/common/notification_service.h" | 24 #include "content/common/notification_service.h" |
26 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 26 #include "ui/base/gtk/owned_widget_gtk.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 = 8; | 35 const unsigned int kMostVisitedCount = 8; |
36 | 36 |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 tab_restore_service_->LoadTabsFromLastSession(); | 434 tab_restore_service_->LoadTabsFromLastSession(); |
435 tab_restore_service_->AddObserver(this); | 435 tab_restore_service_->AddObserver(this); |
436 | 436 |
437 // If LoadTabsFromLastSession doesn't load tabs, it won't call | 437 // If LoadTabsFromLastSession doesn't load tabs, it won't call |
438 // TabRestoreServiceChanged(). This ensures that all new windows after | 438 // TabRestoreServiceChanged(). This ensures that all new windows after |
439 // the first one will have their menus populated correctly. | 439 // the first one will have their menus populated correctly. |
440 TabRestoreServiceChanged(tab_restore_service_); | 440 TabRestoreServiceChanged(tab_restore_service_); |
441 } | 441 } |
442 } | 442 } |
443 } | 443 } |
OLD | NEW |