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

Side by Side Diff: chrome/browser/sessions/session_service.cc

Issue 10917198: Switch NOTIFICATION_TAB_PARENTED to use WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/sessions/session_service.h" 5 #include "chrome/browser/sessions/session_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 !should_track_changes_for_browser_type(browser->type(), app_type)) 597 !should_track_changes_for_browser_type(browser->type(), app_type))
598 return; 598 return;
599 599
600 RestoreIfNecessary(std::vector<GURL>(), browser); 600 RestoreIfNecessary(std::vector<GURL>(), browser);
601 SetWindowType(browser->session_id(), browser->type(), app_type); 601 SetWindowType(browser->session_id(), browser->type(), app_type);
602 SetWindowAppName(browser->session_id(), browser->app_name()); 602 SetWindowAppName(browser->session_id(), browser->app_name());
603 break; 603 break;
604 } 604 }
605 605
606 case chrome::NOTIFICATION_TAB_PARENTED: { 606 case chrome::NOTIFICATION_TAB_PARENTED: {
607 TabContents* tab = content::Source<TabContents>(source).ptr(); 607 WebContents* web_contents = content::Source<WebContents>(source).ptr();
608 if (tab->profile() != profile()) 608 if (web_contents->GetBrowserContext() != profile())
609 return; 609 return;
610 WebContents* web_contents = tab->web_contents();
611 SessionTabHelper* session_tab_helper = 610 SessionTabHelper* session_tab_helper =
612 SessionTabHelper::FromWebContents(web_contents); 611 SessionTabHelper::FromWebContents(web_contents);
613 SetTabWindow(session_tab_helper->window_id(), 612 SetTabWindow(session_tab_helper->window_id(),
614 session_tab_helper->session_id()); 613 session_tab_helper->session_id());
615 extensions::TabHelper* extensions_tab_helper = 614 extensions::TabHelper* extensions_tab_helper =
616 extensions::TabHelper::FromWebContents(web_contents); 615 extensions::TabHelper::FromWebContents(web_contents);
617 if (extensions_tab_helper && 616 if (extensions_tab_helper &&
618 extensions_tab_helper->extension_app()) { 617 extensions_tab_helper->extension_app()) {
619 SetTabExtensionAppID( 618 SetTabExtensionAppID(
620 session_tab_helper->window_id(), 619 session_tab_helper->window_id(),
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1747 50); 1746 50);
1748 if (use_long_period) { 1747 if (use_long_period) {
1749 std::string long_name_("SessionRestore.SaveLongPeriod"); 1748 std::string long_name_("SessionRestore.SaveLongPeriod");
1750 UMA_HISTOGRAM_CUSTOM_TIMES(long_name_, 1749 UMA_HISTOGRAM_CUSTOM_TIMES(long_name_,
1751 delta, 1750 delta,
1752 save_delay_in_mins_, 1751 save_delay_in_mins_,
1753 save_delay_in_hrs_, 1752 save_delay_in_hrs_,
1754 50); 1753 50);
1755 } 1754 }
1756 } 1755 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_service.cc ('k') | chrome/browser/sessions/session_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698