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

Side by Side Diff: chrome/browser/google/google_url_tracker.cc

Issue 6526059: Plumb through NetworkChangeNotifier::IsOffline() to WebKit, enabling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Appease the C++ type system Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/google/google_url_tracker.h ('k') | chrome/browser/intranet_redirect_detector.h » ('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) 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/google/google_url_tracker.h" 5 #include "chrome/browser/google/google_url_tracker.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 in_startup_sleep_(true), 98 in_startup_sleep_(true),
99 already_fetched_(false), 99 already_fetched_(false),
100 need_to_fetch_(false), 100 need_to_fetch_(false),
101 request_context_available_(!!Profile::GetDefaultRequestContext()), 101 request_context_available_(!!Profile::GetDefaultRequestContext()),
102 need_to_prompt_(false), 102 need_to_prompt_(false),
103 controller_(NULL), 103 controller_(NULL),
104 infobar_(NULL) { 104 infobar_(NULL) {
105 registrar_.Add(this, NotificationType::DEFAULT_REQUEST_CONTEXT_AVAILABLE, 105 registrar_.Add(this, NotificationType::DEFAULT_REQUEST_CONTEXT_AVAILABLE,
106 NotificationService::AllSources()); 106 NotificationService::AllSources());
107 107
108 net::NetworkChangeNotifier::AddObserver(this); 108 net::NetworkChangeNotifier::AddIPAddressObserver(this);
109 109
110 MessageLoop::current()->PostTask(FROM_HERE, 110 MessageLoop::current()->PostTask(FROM_HERE,
111 runnable_method_factory_.NewRunnableMethod( 111 runnable_method_factory_.NewRunnableMethod(
112 &GoogleURLTracker::QueueWakeupTask)); 112 &GoogleURLTracker::QueueWakeupTask));
113 } 113 }
114 114
115 GoogleURLTracker::~GoogleURLTracker() { 115 GoogleURLTracker::~GoogleURLTracker() {
116 runnable_method_factory_.RevokeAll(); 116 runnable_method_factory_.RevokeAll();
117 net::NetworkChangeNotifier::RemoveObserver(this); 117 net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
118 } 118 }
119 119
120 // static 120 // static
121 GURL GoogleURLTracker::GoogleURL() { 121 GURL GoogleURLTracker::GoogleURL() {
122 const GoogleURLTracker* const tracker = 122 const GoogleURLTracker* const tracker =
123 g_browser_process->google_url_tracker(); 123 g_browser_process->google_url_tracker();
124 return tracker ? tracker->google_url_ : GURL(kDefaultGoogleHomepage); 124 return tracker ? tracker->google_url_ : GURL(kDefaultGoogleHomepage);
125 } 125 }
126 126
127 // static 127 // static
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 } 367 }
368 368
369 void GoogleURLTracker::ShowGoogleURLInfoBarIfNecessary( 369 void GoogleURLTracker::ShowGoogleURLInfoBarIfNecessary(
370 TabContents* tab_contents) { 370 TabContents* tab_contents) {
371 if (!need_to_prompt_) 371 if (!need_to_prompt_)
372 return; 372 return;
373 DCHECK(!fetched_google_url_.is_empty()); 373 DCHECK(!fetched_google_url_.is_empty());
374 374
375 infobar_ = (*infobar_creator_)(tab_contents, this, fetched_google_url_); 375 infobar_ = (*infobar_creator_)(tab_contents, this, fetched_google_url_);
376 } 376 }
OLDNEW
« no previous file with comments | « chrome/browser/google/google_url_tracker.h ('k') | chrome/browser/intranet_redirect_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698