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

Side by Side Diff: chrome/browser/extensions/extension_webnavigation_api.cc

Issue 9030010: Move most of the remaining users of WebContentsObserver::tab_contents() to use web_contents(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 12 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/extensions/extension_tabs_module.cc ('k') | chrome/browser/plugin_observer.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) 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 // Implements the Chrome Extensions WebNavigation API. 5 // Implements the Chrome Extensions WebNavigation API.
6 6
7 #include "chrome/browser/extensions/extension_webnavigation_api.h" 7 #include "chrome/browser/extensions/extension_webnavigation_api.h"
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } 409 }
410 } 410 }
411 411
412 void ExtensionWebNavigationEventRouter::Retargeting( 412 void ExtensionWebNavigationEventRouter::Retargeting(
413 const RetargetingDetails* details) { 413 const RetargetingDetails* details) {
414 if (details->source_frame_id == 0) 414 if (details->source_frame_id == 0)
415 return; 415 return;
416 ExtensionWebNavigationTabObserver* tab_observer = 416 ExtensionWebNavigationTabObserver* tab_observer =
417 ExtensionWebNavigationTabObserver::Get(details->source_web_contents); 417 ExtensionWebNavigationTabObserver::Get(details->source_web_contents);
418 if (!tab_observer) { 418 if (!tab_observer) {
419 CHECK(details->source_web_contents->GetRenderViewHost()->delegate()-> 419 CHECK(details->source_web_contents->GetViewType() !=
420 GetRenderViewType() != content::VIEW_TYPE_TAB_CONTENTS); 420 content::VIEW_TYPE_TAB_CONTENTS);
421 return; 421 return;
422 } 422 }
423 const FrameNavigationState& frame_navigation_state = 423 const FrameNavigationState& frame_navigation_state =
424 tab_observer->frame_navigation_state(); 424 tab_observer->frame_navigation_state();
425 425
426 if (!frame_navigation_state.CanSendEvents(details->source_frame_id)) 426 if (!frame_navigation_state.CanSendEvents(details->source_frame_id))
427 return; 427 return;
428 428
429 // If the WebContents was created as a response to an IPC from a renderer 429 // If the WebContents was created as a response to an IPC from a renderer
430 // (and therefore doesn't yet have a wrapper), or if it isn't yet inserted 430 // (and therefore doesn't yet have a wrapper), or if it isn't yet inserted
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 keys::kFrameIdKey, 740 keys::kFrameIdKey,
741 GetFrameId(navigation_state.IsMainFrame(*frame), *frame)); 741 GetFrameId(navigation_state.IsMainFrame(*frame), *frame));
742 frameDict->SetBoolean( 742 frameDict->SetBoolean(
743 keys::kErrorOccurredKey, 743 keys::kErrorOccurredKey,
744 navigation_state.GetErrorOccurredInFrame(*frame)); 744 navigation_state.GetErrorOccurredInFrame(*frame));
745 resultList->Append(frameDict); 745 resultList->Append(frameDict);
746 } 746 }
747 result_.reset(resultList); 747 result_.reset(resultList);
748 return true; 748 return true;
749 } 749 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module.cc ('k') | chrome/browser/plugin_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698