| 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/extensions/api/sessions/sessions_api.h" | 5 #include "chrome/browser/extensions/api/sessions/sessions_api.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "chrome/browser/extensions/api/sessions/session_id.h" | 16 #include "chrome/browser/extensions/api/sessions/session_id.h" |
| 17 #include "chrome/browser/extensions/api/tabs/windows_util.h" | 17 #include "chrome/browser/extensions/api/tabs/windows_util.h" |
| 18 #include "chrome/browser/extensions/extension_tab_util.h" | 18 #include "chrome/browser/extensions/extension_tab_util.h" |
| 19 #include "chrome/browser/extensions/window_controller.h" | 19 #include "chrome/browser/extensions/window_controller.h" |
| 20 #include "chrome/browser/extensions/window_controller_list.h" | 20 #include "chrome/browser/extensions/window_controller_list.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/browser/search/search.h" | 22 #include "chrome/browser/search/search.h" |
| 23 #include "chrome/browser/sessions/session_restore.h" | 23 #include "chrome/browser/sessions/session_restore.h" |
| 24 #include "chrome/browser/sessions/tab_restore_service_delegate.h" | 24 #include "chrome/browser/sessions/tab_restore_service_delegate.h" |
| 25 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 25 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 26 #include "chrome/browser/sync/profile_sync_service.h" | 26 #include "chrome/browser/sync/profile_sync_service.h" |
| 27 #include "chrome/browser/sync/profile_sync_service_factory.h" | 27 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 28 #include "chrome/browser/ui/browser.h" | 28 #include "chrome/browser/ui/browser.h" |
| 29 #include "chrome/browser/ui/browser_finder.h" | 29 #include "chrome/browser/ui/browser_finder.h" |
| 30 #include "chrome/browser/ui/host_desktop.h" | |
| 31 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 32 #include "chrome/common/pref_names.h" | 31 #include "chrome/common/pref_names.h" |
| 33 #include "components/sync_driver/glue/synced_session.h" | 32 #include "components/sync_driver/glue/synced_session.h" |
| 34 #include "components/sync_driver/open_tabs_ui_delegate.h" | 33 #include "components/sync_driver/open_tabs_ui_delegate.h" |
| 35 #include "components/url_formatter/url_formatter.h" | 34 #include "components/url_formatter/url_formatter.h" |
| 36 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
| 37 #include "extensions/browser/extension_function_dispatcher.h" | 36 #include "extensions/browser/extension_function_dispatcher.h" |
| 38 #include "extensions/browser/extension_function_registry.h" | 37 #include "extensions/browser/extension_function_registry.h" |
| 39 #include "extensions/browser/extension_system.h" | 38 #include "extensions/browser/extension_system.h" |
| 40 #include "extensions/common/error_utils.h" | 39 #include "extensions/common/error_utils.h" |
| 41 #include "ui/base/layout.h" | 40 #include "ui/base/layout.h" |
| 41 #include "ui/gfx/host_desktop_type.h" |
| 42 | 42 |
| 43 namespace extensions { | 43 namespace extensions { |
| 44 | 44 |
| 45 namespace GetRecentlyClosed = api::sessions::GetRecentlyClosed; | 45 namespace GetRecentlyClosed = api::sessions::GetRecentlyClosed; |
| 46 namespace GetDevices = api::sessions::GetDevices; | 46 namespace GetDevices = api::sessions::GetDevices; |
| 47 namespace Restore = api::sessions::Restore; | 47 namespace Restore = api::sessions::Restore; |
| 48 namespace tabs = api::tabs; | 48 namespace tabs = api::tabs; |
| 49 namespace windows = api::windows; | 49 namespace windows = api::windows; |
| 50 | 50 |
| 51 const char kNoRecentlyClosedSessionsError[] = | 51 const char kNoRecentlyClosedSessionsError[] = |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 return g_factory.Pointer(); | 650 return g_factory.Pointer(); |
| 651 } | 651 } |
| 652 | 652 |
| 653 void SessionsAPI::OnListenerAdded(const EventListenerInfo& details) { | 653 void SessionsAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 654 sessions_event_router_.reset( | 654 sessions_event_router_.reset( |
| 655 new SessionsEventRouter(Profile::FromBrowserContext(browser_context_))); | 655 new SessionsEventRouter(Profile::FromBrowserContext(browser_context_))); |
| 656 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 656 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 657 } | 657 } |
| 658 | 658 |
| 659 } // namespace extensions | 659 } // namespace extensions |
| OLD | NEW |