| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/toolbar/recent_tabs_sub_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
| 12 #include "chrome/browser/favicon/favicon_service_factory.h" | 12 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 13 #include "chrome/browser/favicon/favicon_types.h" | |
| 14 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 13 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/sessions/session_restore.h" | 15 #include "chrome/browser/sessions/session_restore.h" |
| 17 #include "chrome/browser/sessions/tab_restore_service.h" | 16 #include "chrome/browser/sessions/tab_restore_service.h" |
| 18 #include "chrome/browser/sessions/tab_restore_service_delegate.h" | 17 #include "chrome/browser/sessions/tab_restore_service_delegate.h" |
| 19 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 18 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 20 #include "chrome/browser/sync/glue/session_model_associator.h" | 19 #include "chrome/browser/sync/glue/session_model_associator.h" |
| 21 #include "chrome/browser/sync/glue/synced_session.h" | 20 #include "chrome/browser/sync/glue/synced_session.h" |
| 22 #include "chrome/browser/sync/profile_sync_service.h" | 21 #include "chrome/browser/sync/profile_sync_service.h" |
| 23 #include "chrome/browser/sync/profile_sync_service_factory.h" | 22 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 24 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
| 25 #include "chrome/browser/ui/browser_commands.h" | 24 #include "chrome/browser/ui/browser_commands.h" |
| 26 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 25 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 26 #include "chrome/common/favicon/favicon_types.h" |
| 27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "chrome/common/time_format.h" | 28 #include "chrome/common/time_format.h" |
| 29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 30 #include "grit/browser_resources.h" | 30 #include "grit/browser_resources.h" |
| 31 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
| 32 #include "grit/theme_resources.h" | 32 #include "grit/theme_resources.h" |
| 33 #include "grit/ui_resources.h" | 33 #include "grit/ui_resources.h" |
| 34 #include "ui/base/accelerators/accelerator.h" | 34 #include "ui/base/accelerators/accelerator.h" |
| 35 #include "ui/base/l10n/l10n_util.h" | 35 #include "ui/base/l10n/l10n_util.h" |
| 36 #include "ui/base/resource/resource_bundle.h" | 36 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 RecentTabsSubMenuModel::GetModelAssociator() { | 582 RecentTabsSubMenuModel::GetModelAssociator() { |
| 583 if (!associator_) { | 583 if (!associator_) { |
| 584 ProfileSyncService* service = ProfileSyncServiceFactory::GetInstance()-> | 584 ProfileSyncService* service = ProfileSyncServiceFactory::GetInstance()-> |
| 585 GetForProfile(browser_->profile()); | 585 GetForProfile(browser_->profile()); |
| 586 // Only return the associator if it exists and it is done syncing sessions. | 586 // Only return the associator if it exists and it is done syncing sessions. |
| 587 if (service && service->ShouldPushChanges()) | 587 if (service && service->ShouldPushChanges()) |
| 588 associator_ = service->GetSessionModelAssociator(); | 588 associator_ = service->GetSessionModelAssociator(); |
| 589 } | 589 } |
| 590 return associator_; | 590 return associator_; |
| 591 } | 591 } |
| OLD | NEW |