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

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

Issue 10944016: Switch SearchTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const 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
« no previous file with comments | « no previous file | chrome/browser/ui/omnibox/omnibox_edit_model.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 (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/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 // Sever the WebContents' connection back to us. 1038 // Sever the WebContents' connection back to us.
1039 SetAsDelegate(contents->web_contents(), NULL); 1039 SetAsDelegate(contents->web_contents(), NULL);
1040 } 1040 }
1041 1041
1042 void Browser::TabDetachedAt(TabContents* contents, int index) { 1042 void Browser::TabDetachedAt(TabContents* contents, int index) {
1043 TabDetachedAtImpl(contents, index, DETACH_TYPE_DETACH); 1043 TabDetachedAtImpl(contents, index, DETACH_TYPE_DETACH);
1044 } 1044 }
1045 1045
1046 void Browser::TabDeactivated(TabContents* contents) { 1046 void Browser::TabDeactivated(TabContents* contents) {
1047 fullscreen_controller_->OnTabDeactivated(contents); 1047 fullscreen_controller_->OnTabDeactivated(contents);
1048 search_delegate_->OnTabDeactivated(contents); 1048 search_delegate_->OnTabDeactivated(contents->web_contents());
1049 1049
1050 // Save what the user's currently typing, so it can be restored when we 1050 // Save what the user's currently typing, so it can be restored when we
1051 // switch back to this tab. 1051 // switch back to this tab.
1052 window_->GetLocationBar()->SaveStateToContents(contents->web_contents()); 1052 window_->GetLocationBar()->SaveStateToContents(contents->web_contents());
1053 } 1053 }
1054 1054
1055 void Browser::ActiveTabChanged(TabContents* old_contents, 1055 void Browser::ActiveTabChanged(TabContents* old_contents,
1056 TabContents* new_contents, 1056 TabContents* new_contents,
1057 int index, 1057 int index,
1058 bool user_gesture) { 1058 bool user_gesture) {
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
1907 /////////////////////////////////////////////////////////////////////////////// 1907 ///////////////////////////////////////////////////////////////////////////////
1908 // Browser, UI update coalescing and handling (private): 1908 // Browser, UI update coalescing and handling (private):
1909 1909
1910 void Browser::UpdateToolbar(bool should_restore_state) { 1910 void Browser::UpdateToolbar(bool should_restore_state) {
1911 window_->UpdateToolbar(chrome::GetActiveTabContents(this), 1911 window_->UpdateToolbar(chrome::GetActiveTabContents(this),
1912 should_restore_state); 1912 should_restore_state);
1913 } 1913 }
1914 1914
1915 void Browser::UpdateSearchState(TabContents* contents) { 1915 void Browser::UpdateSearchState(TabContents* contents) {
1916 if (chrome::search::IsInstantExtendedAPIEnabled(profile_)) 1916 if (chrome::search::IsInstantExtendedAPIEnabled(profile_))
1917 search_delegate_->OnTabActivated(contents); 1917 search_delegate_->OnTabActivated(contents->web_contents());
1918 } 1918 }
1919 1919
1920 void Browser::ScheduleUIUpdate(const WebContents* source, 1920 void Browser::ScheduleUIUpdate(const WebContents* source,
1921 unsigned changed_flags) { 1921 unsigned changed_flags) {
1922 if (!source) 1922 if (!source)
1923 return; 1923 return;
1924 1924
1925 // Do some synchronous updates. 1925 // Do some synchronous updates.
1926 if (changed_flags & content::INVALIDATE_TYPE_URL && 1926 if (changed_flags & content::INVALIDATE_TYPE_URL &&
1927 source == chrome::GetActiveWebContents(this)) { 1927 source == chrome::GetActiveWebContents(this)) {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 } 2122 }
2123 2123
2124 SetAsDelegate(contents->web_contents(), NULL); 2124 SetAsDelegate(contents->web_contents(), NULL);
2125 RemoveScheduledUpdatesFor(contents->web_contents()); 2125 RemoveScheduledUpdatesFor(contents->web_contents());
2126 2126
2127 if (find_bar_controller_.get() && index == active_index()) { 2127 if (find_bar_controller_.get() && index == active_index()) {
2128 find_bar_controller_->ChangeTabContents(NULL); 2128 find_bar_controller_->ChangeTabContents(NULL);
2129 } 2129 }
2130 2130
2131 // Stop observing search model changes for this tab. 2131 // Stop observing search model changes for this tab.
2132 search_delegate_->OnTabDetached(contents); 2132 search_delegate_->OnTabDetached(contents->web_contents());
2133 2133
2134 registrar_.Remove(this, content::NOTIFICATION_INTERSTITIAL_ATTACHED, 2134 registrar_.Remove(this, content::NOTIFICATION_INTERSTITIAL_ATTACHED,
2135 content::Source<WebContents>(contents->web_contents())); 2135 content::Source<WebContents>(contents->web_contents()));
2136 registrar_.Remove(this, content::NOTIFICATION_INTERSTITIAL_DETACHED, 2136 registrar_.Remove(this, content::NOTIFICATION_INTERSTITIAL_DETACHED,
2137 content::Source<WebContents>(contents->web_contents())); 2137 content::Source<WebContents>(contents->web_contents()));
2138 } 2138 }
2139 2139
2140 bool Browser::SupportsWindowFeatureImpl(WindowFeature feature, 2140 bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,
2141 bool check_fullscreen) const { 2141 bool check_fullscreen) const {
2142 // On Mac, fullscreen mode has most normal things (in a slide-down panel). On 2142 // On Mac, fullscreen mode has most normal things (in a slide-down panel). On
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2284 if (contents && !allow_js_access) { 2284 if (contents && !allow_js_access) {
2285 contents->web_contents()->GetController().LoadURL( 2285 contents->web_contents()->GetController().LoadURL(
2286 target_url, 2286 target_url,
2287 content::Referrer(), 2287 content::Referrer(),
2288 content::PAGE_TRANSITION_LINK, 2288 content::PAGE_TRANSITION_LINK,
2289 std::string()); // No extra headers. 2289 std::string()); // No extra headers.
2290 } 2290 }
2291 2291
2292 return contents != NULL; 2292 return contents != NULL;
2293 } 2293 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/omnibox/omnibox_edit_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698