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

Side by Side Diff: chrome/browser/prerender/prerender_tab_helper.cc

Issue 9030032: Get rid of a bunch of tab_contents.h includes from chrome. These are all trivial changes to use W... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros Created 8 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/prerender/prerender_tab_helper.h" 5 #include "chrome/browser/prerender/prerender_tab_helper.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "chrome/browser/prerender/prerender_manager.h" 10 #include "chrome/browser/prerender/prerender_manager.h"
11 #include "chrome/browser/prerender/prerender_manager_factory.h" 11 #include "chrome/browser/prerender/prerender_manager_factory.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 13 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
15 #include "content/browser/tab_contents/tab_contents.h" 15 #include "content/public/browser/web_contents.h"
16 16
17 namespace prerender { 17 namespace prerender {
18 18
19 namespace { 19 namespace {
20 20
21 const int kMinHoverThresholdsMs[] = { 21 const int kMinHoverThresholdsMs[] = {
22 250 22 250
23 }; 23 };
24 24
25 // Overview of hover-related histograms: 25 // Overview of hover-related histograms:
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // The time & url of a new hover that does not meet the threshold for 159 // The time & url of a new hover that does not meet the threshold for
160 // prerendering and may replace the prerender currently being prerendered. 160 // prerendering and may replace the prerender currently being prerendered.
161 base::TimeTicks new_time_; 161 base::TimeTicks new_time_;
162 GURL new_url_; 162 GURL new_url_;
163 163
164 // The threshold for hovering. 164 // The threshold for hovering.
165 base::TimeDelta hover_threshold_; 165 base::TimeDelta hover_threshold_;
166 }; 166 };
167 167
168 PrerenderTabHelper::PrerenderTabHelper(TabContentsWrapper* tab) 168 PrerenderTabHelper::PrerenderTabHelper(TabContentsWrapper* tab)
169 : content::WebContentsObserver(tab->tab_contents()), 169 : content::WebContentsObserver(tab->web_contents()),
170 tab_(tab), 170 tab_(tab),
171 pplt_load_start_(), 171 pplt_load_start_(),
172 last_hovers_(new HoverData[kNumHoverThresholds]) { 172 last_hovers_(new HoverData[kNumHoverThresholds]) {
173 for (int i = 0; i < kNumHoverThresholds; i++) 173 for (int i = 0; i < kNumHoverThresholds; i++)
174 last_hovers_[i].SetHoverThreshold(kMinHoverThresholdsMs[i]); 174 last_hovers_[i].SetHoverThreshold(kMinHoverThresholdsMs[i]);
175 } 175 }
176 176
177 PrerenderTabHelper::~PrerenderTabHelper() { 177 PrerenderTabHelper::~PrerenderTabHelper() {
178 } 178 }
179 179
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 302
303 current_hover_url_ = GURL(); 303 current_hover_url_ = GURL();
304 } 304 }
305 305
306 bool PrerenderTabHelper::IsTopSite(const GURL& url) { 306 bool PrerenderTabHelper::IsTopSite(const GURL& url) {
307 PrerenderManager* pm = MaybeGetPrerenderManager(); 307 PrerenderManager* pm = MaybeGetPrerenderManager();
308 return (pm && pm->IsTopSite(url)); 308 return (pm && pm->IsTopSite(url));
309 } 309 }
310 310
311 } // namespace prerender 311 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | chrome/browser/printing/background_printing_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698