| 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" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 tabs->push_back(make_linked_ptr( | 283 tabs->push_back(make_linked_ptr( |
| 284 CreateTabModel(session_tag, *tabs_in_window[i], i, | 284 CreateTabModel(session_tag, *tabs_in_window[i], i, |
| 285 window.selected_tab_index).release())); | 285 window.selected_tab_index).release())); |
| 286 } | 286 } |
| 287 | 287 |
| 288 std::string session_id = | 288 std::string session_id = |
| 289 SessionId(session_tag, window.window_id.id()).ToString(); | 289 SessionId(session_tag, window.window_id.id()).ToString(); |
| 290 | 290 |
| 291 windows::Window::Type type = windows::Window::TYPE_NONE; | 291 windows::Window::Type type = windows::Window::TYPE_NONE; |
| 292 switch (window.type) { | 292 switch (window.type) { |
| 293 case Browser::TYPE_TABBED: | 293 case SessionWindow::TYPE_TABBED: |
| 294 type = windows::Window::TYPE_NORMAL; | 294 type = windows::Window::TYPE_NORMAL; |
| 295 break; | 295 break; |
| 296 case Browser::TYPE_POPUP: | 296 case SessionWindow::TYPE_POPUP: |
| 297 type = windows::Window::TYPE_POPUP; | 297 type = windows::Window::TYPE_POPUP; |
| 298 break; | 298 break; |
| 299 } | 299 } |
| 300 | 300 |
| 301 windows::Window::State state = windows::Window::STATE_NONE; | 301 windows::Window::State state = windows::Window::STATE_NONE; |
| 302 switch (window.show_state) { | 302 switch (window.show_state) { |
| 303 case ui::SHOW_STATE_NORMAL: | 303 case ui::SHOW_STATE_NORMAL: |
| 304 state = windows::Window::STATE_NORMAL; | 304 state = windows::Window::STATE_NORMAL; |
| 305 break; | 305 break; |
| 306 case ui::SHOW_STATE_MINIMIZED: | 306 case ui::SHOW_STATE_MINIMIZED: |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 return g_factory.Pointer(); | 648 return g_factory.Pointer(); |
| 649 } | 649 } |
| 650 | 650 |
| 651 void SessionsAPI::OnListenerAdded(const EventListenerInfo& details) { | 651 void SessionsAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 652 sessions_event_router_.reset( | 652 sessions_event_router_.reset( |
| 653 new SessionsEventRouter(Profile::FromBrowserContext(browser_context_))); | 653 new SessionsEventRouter(Profile::FromBrowserContext(browser_context_))); |
| 654 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 654 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 655 } | 655 } |
| 656 | 656 |
| 657 } // namespace extensions | 657 } // namespace extensions |
| OLD | NEW |