Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(475)

Side by Side Diff: chrome/browser/extensions/api/sessions/sessions_api.cc

Issue 1662783002: Remove HostDesktopType from Browser::CreateParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-12
Patch Set: remove desktop_type_ in bookmark_bubble_sign_in_delegate Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 windows.begin(); 561 windows.begin();
562 while (window != windows.end() 562 while (window != windows.end()
563 && (*window)->window_id.id() != session_id.id()) { 563 && (*window)->window_id.id() != session_id.id()) {
564 ++window; 564 ++window;
565 } 565 }
566 if (window == windows.end()) { 566 if (window == windows.end()) {
567 SetInvalidIdError(session_id.ToString()); 567 SetInvalidIdError(session_id.ToString());
568 return false; 568 return false;
569 } 569 }
570 570
571 chrome::HostDesktopType host_desktop_type = browser->host_desktop_type();
572 // Only restore one window at a time. 571 // Only restore one window at a time.
573 std::vector<Browser*> browsers = SessionRestore::RestoreForeignSessionWindows( 572 std::vector<Browser*> browsers = SessionRestore::RestoreForeignSessionWindows(
574 GetProfile(), host_desktop_type, window, window + 1); 573 GetProfile(), window, window + 1);
575 // Will always create one browser because we only restore one window per call. 574 // Will always create one browser because we only restore one window per call.
576 DCHECK_EQ(1u, browsers.size()); 575 DCHECK_EQ(1u, browsers.size());
577 return SetResultRestoredWindow(ExtensionTabUtil::GetWindowId(browsers[0])); 576 return SetResultRestoredWindow(ExtensionTabUtil::GetWindowId(browsers[0]));
578 } 577 }
579 578
580 bool SessionsRestoreFunction::RunSync() { 579 bool SessionsRestoreFunction::RunSync() {
581 scoped_ptr<Restore::Params> params(Restore::Params::Create(*args_)); 580 scoped_ptr<Restore::Params> params(Restore::Params::Create(*args_));
582 EXTENSION_FUNCTION_VALIDATE(params); 581 EXTENSION_FUNCTION_VALIDATE(params);
583 582
584 Browser* browser = chrome::FindBrowserWithProfile(GetProfile()); 583 Browser* browser = chrome::FindBrowserWithProfile(GetProfile());
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 return g_factory.Pointer(); 655 return g_factory.Pointer();
657 } 656 }
658 657
659 void SessionsAPI::OnListenerAdded(const EventListenerInfo& details) { 658 void SessionsAPI::OnListenerAdded(const EventListenerInfo& details) {
660 sessions_event_router_.reset( 659 sessions_event_router_.reset(
661 new SessionsEventRouter(Profile::FromBrowserContext(browser_context_))); 660 new SessionsEventRouter(Profile::FromBrowserContext(browser_context_)));
662 EventRouter::Get(browser_context_)->UnregisterObserver(this); 661 EventRouter::Get(browser_context_)->UnregisterObserver(this);
663 } 662 }
664 663
665 } // namespace extensions 664 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698