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

Side by Side Diff: chrome/browser/extensions/api/web_navigation/web_navigation_api.cc

Issue 10964048: Switch WebNavigationTabObserver to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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 // Implements the Chrome Extensions WebNavigation API. 5 // Implements the Chrome Extensions WebNavigation API.
6 6
7 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" 7 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api_consta nts.h" 10 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api_consta nts.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 pending_web_contents_.begin(); i != pending_web_contents_.end(); ) { 246 pending_web_contents_.begin(); i != pending_web_contents_.end(); ) {
247 if (i->second.source_web_contents == tab) 247 if (i->second.source_web_contents == tab)
248 pending_web_contents_.erase(i++); 248 pending_web_contents_.erase(i++);
249 else 249 else
250 ++i; 250 ++i;
251 } 251 }
252 } 252 }
253 253
254 // WebNavigationTabObserver ------------------------------------------ 254 // WebNavigationTabObserver ------------------------------------------
255 255
256 int WebNavigationTabObserver::kUserDataKey;
257
256 WebNavigationTabObserver::WebNavigationTabObserver( 258 WebNavigationTabObserver::WebNavigationTabObserver(
257 content::WebContents* web_contents) 259 content::WebContents* web_contents)
258 : WebContentsObserver(web_contents), 260 : WebContentsObserver(web_contents),
259 render_view_host_(NULL), 261 render_view_host_(NULL),
260 pending_render_view_host_(NULL) { 262 pending_render_view_host_(NULL) {
261 g_tab_observer.Get().insert(TabObserverMap::value_type(web_contents, this)); 263 g_tab_observer.Get().insert(TabObserverMap::value_type(web_contents, this));
262 registrar_.Add(this, 264 registrar_.Add(this,
263 content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, 265 content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT,
264 content::Source<content::WebContents>(web_contents)); 266 content::Source<content::WebContents>(web_contents));
265 registrar_.Add(this, 267 registrar_.Add(this,
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 navigation_state.IsMainFrame(frame_id), frame_id.frame_num); 722 navigation_state.IsMainFrame(frame_id), frame_id.frame_num);
721 frame->process_id = frame_id.render_view_host->GetProcess()->GetID(); 723 frame->process_id = frame_id.render_view_host->GetProcess()->GetID();
722 frame->error_occurred = navigation_state.GetErrorOccurredInFrame(frame_id); 724 frame->error_occurred = navigation_state.GetErrorOccurredInFrame(frame_id);
723 result_list.push_back(frame); 725 result_list.push_back(frame);
724 } 726 }
725 results_ = GetAllFrames::Results::Create(result_list); 727 results_ = GetAllFrames::Results::Create(result_list);
726 return true; 728 return true;
727 } 729 }
728 730
729 } // namespace extensions 731 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_navigation/web_navigation_api.h ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698