Chromium Code Reviews

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

Issue 4996003: Fix crash due to erroneous use of |controller_|.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 295 matching lines...)
306 const NotificationDetails& details) { 306 const NotificationDetails& details) {
307 switch (type.value) { 307 switch (type.value) {
308 case NotificationType::DEFAULT_REQUEST_CONTEXT_AVAILABLE: 308 case NotificationType::DEFAULT_REQUEST_CONTEXT_AVAILABLE:
309 registrar_.Remove(this, 309 registrar_.Remove(this,
310 NotificationType::DEFAULT_REQUEST_CONTEXT_AVAILABLE, 310 NotificationType::DEFAULT_REQUEST_CONTEXT_AVAILABLE,
311 NotificationService::AllSources()); 311 NotificationService::AllSources());
312 request_context_available_ = true; 312 request_context_available_ = true;
313 StartFetchIfDesirable(); 313 StartFetchIfDesirable();
314 break; 314 break;
315 315
316 case NotificationType::NAV_ENTRY_PENDING: 316 case NotificationType::NAV_ENTRY_PENDING: {
317 OnNavigationPending(source, controller_->pending_entry()->url()); 317 NavigationController* controller =
318 Source<NavigationController>(source).ptr();
319 OnNavigationPending(source, controller->pending_entry()->url());
318 break; 320 break;
321 }
Ilya Sherman 2010/11/15 19:40:51 nit: Please either add braces to the other case st
319 322
320 case NotificationType::NAV_ENTRY_COMMITTED: 323 case NotificationType::NAV_ENTRY_COMMITTED:
321 case NotificationType::TAB_CLOSED: 324 case NotificationType::TAB_CLOSED:
322 OnNavigationCommittedOrTabClosed( 325 OnNavigationCommittedOrTabClosed(
323 Source<NavigationController>(source).ptr()->tab_contents(), 326 Source<NavigationController>(source).ptr()->tab_contents(),
324 type.value); 327 type.value);
325 break; 328 break;
326 329
327 default: 330 default:
328 NOTREACHED() << "Unknown notification received:" << type.value; 331 NOTREACHED() << "Unknown notification received:" << type.value;
(...skipping 42 matching lines...)
371 } 374 }
372 375
373 void GoogleURLTracker::ShowGoogleURLInfoBarIfNecessary( 376 void GoogleURLTracker::ShowGoogleURLInfoBarIfNecessary(
374 TabContents* tab_contents) { 377 TabContents* tab_contents) {
375 if (!need_to_prompt_) 378 if (!need_to_prompt_)
376 return; 379 return;
377 DCHECK(!fetched_google_url_.is_empty()); 380 DCHECK(!fetched_google_url_.is_empty());
378 381
379 infobar_ = (*infobar_creator_)(tab_contents, this, fetched_google_url_); 382 infobar_ = (*infobar_creator_)(tab_contents, this, fetched_google_url_);
380 } 383 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine