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

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

Issue 425653002: content: ResourceType cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: REBASE Created 6 years, 4 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/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 render_frame_host, 553 render_frame_host,
554 navigation_state_.GetUrl(render_frame_host), 554 navigation_state_.GetUrl(render_frame_host),
555 error_code); 555 error_code);
556 } 556 }
557 navigation_state_.SetErrorOccurredInFrame(render_frame_host); 557 navigation_state_.SetErrorOccurredInFrame(render_frame_host);
558 } 558 }
559 559
560 void WebNavigationTabObserver::DidGetRedirectForResourceRequest( 560 void WebNavigationTabObserver::DidGetRedirectForResourceRequest(
561 content::RenderViewHost* render_view_host, 561 content::RenderViewHost* render_view_host,
562 const content::ResourceRedirectDetails& details) { 562 const content::ResourceRedirectDetails& details) {
563 if (details.resource_type != ResourceType::MAIN_FRAME && 563 if (details.resource_type != content::RESOURCE_TYPE_MAIN_FRAME &&
564 details.resource_type != ResourceType::SUB_FRAME) { 564 details.resource_type != content::RESOURCE_TYPE_SUB_FRAME) {
565 return; 565 return;
566 } 566 }
567 content::RenderFrameHost* render_frame_host = 567 content::RenderFrameHost* render_frame_host =
568 content::RenderFrameHost::FromID(render_view_host->GetProcess()->GetID(), 568 content::RenderFrameHost::FromID(render_view_host->GetProcess()->GetID(),
569 details.render_frame_id); 569 details.render_frame_id);
570 navigation_state_.SetIsServerRedirected(render_frame_host); 570 navigation_state_.SetIsServerRedirected(render_frame_host);
571 } 571 }
572 572
573 void WebNavigationTabObserver::DidOpenRequestedURL( 573 void WebNavigationTabObserver::DidOpenRequestedURL(
574 content::WebContents* new_contents, 574 content::WebContents* new_contents,
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 return g_factory.Pointer(); 770 return g_factory.Pointer();
771 } 771 }
772 772
773 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) { 773 void WebNavigationAPI::OnListenerAdded(const EventListenerInfo& details) {
774 web_navigation_event_router_.reset(new WebNavigationEventRouter( 774 web_navigation_event_router_.reset(new WebNavigationEventRouter(
775 Profile::FromBrowserContext(browser_context_))); 775 Profile::FromBrowserContext(browser_context_)));
776 EventRouter::Get(browser_context_)->UnregisterObserver(this); 776 EventRouter::Get(browser_context_)->UnregisterObserver(this);
777 } 777 }
778 778
779 } // namespace extensions 779 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698