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

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 2757863002: SearchTabHelper: Find browser/window instead of having them passed in (Closed)
Patch Set: nits Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 // Browser, TabStripModelObserver implementation: 967 // Browser, TabStripModelObserver implementation:
968 968
969 void Browser::TabInsertedAt(TabStripModel* tab_strip_model, 969 void Browser::TabInsertedAt(TabStripModel* tab_strip_model,
970 WebContents* contents, 970 WebContents* contents,
971 int index, 971 int index,
972 bool foreground) { 972 bool foreground) {
973 SetAsDelegate(contents, true); 973 SetAsDelegate(contents, true);
974 974
975 SessionTabHelper::FromWebContents(contents)->SetWindowID(session_id()); 975 SessionTabHelper::FromWebContents(contents)->SetWindowID(session_id());
976 976
977 SearchTabHelper::FromWebContents(contents)->OnTabAttachedToWindow(window_);
978
979 content::NotificationService::current()->Notify( 977 content::NotificationService::current()->Notify(
980 chrome::NOTIFICATION_TAB_PARENTED, 978 chrome::NOTIFICATION_TAB_PARENTED,
981 content::Source<content::WebContents>(contents), 979 content::Source<content::WebContents>(contents),
982 content::NotificationService::NoDetails()); 980 content::NotificationService::NoDetails());
983 981
984 SyncHistoryWithTabs(index); 982 SyncHistoryWithTabs(index);
985 983
986 // Make sure the loading state is updated correctly, otherwise the throbber 984 // Make sure the loading state is updated correctly, otherwise the throbber
987 // won't start if the page is loading. 985 // won't start if the page is loading.
988 LoadingStateChanged(contents, true); 986 LoadingStateChanged(contents, true);
(...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 // new window later, thus we need to navigate the window now. 2661 // new window later, thus we need to navigate the window now.
2664 if (contents) { 2662 if (contents) {
2665 contents->web_contents()->GetController().LoadURL( 2663 contents->web_contents()->GetController().LoadURL(
2666 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, 2664 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK,
2667 std::string()); // No extra headers. 2665 std::string()); // No extra headers.
2668 } 2666 }
2669 } 2667 }
2670 2668
2671 return contents != NULL; 2669 return contents != NULL;
2672 } 2670 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698