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

Side by Side Diff: chrome/browser/web_contents.cc

Issue 8206: Update contents_mime_type_ of WebContents only for the main frame. RenderView... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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 | « 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/web_contents.h" 5 #include "chrome/browser/web_contents.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 // TODO(brettw) the old code only checked for INTERSTIAL, this new code also 681 // TODO(brettw) the old code only checked for INTERSTIAL, this new code also
682 // checks for LEAVING_INTERSTITIAL mode in the manager. Is this difference 682 // checks for LEAVING_INTERSTITIAL mode in the manager. Is this difference
683 // important? 683 // important?
684 if (!GetSiteInstance()->has_site() && 684 if (!GetSiteInstance()->has_site() &&
685 !render_manager_.showing_interstitial_page()) 685 !render_manager_.showing_interstitial_page())
686 GetSiteInstance()->SetSite(params.url); 686 GetSiteInstance()->SetSite(params.url);
687 687
688 // Need to update MIME type here because it's referred to in 688 // Need to update MIME type here because it's referred to in
689 // UpdateNavigationCommands() called by RendererDidNavigate() to 689 // UpdateNavigationCommands() called by RendererDidNavigate() to
690 // determine whether or not to enable the encoding menu. 690 // determine whether or not to enable the encoding menu.
691 // It's updated only for the main frame. For a subframe,
692 // RenderView::UpdateURL does not set params.contents_mime_type.
693 // (see http://code.google.com/p/chromium/issues/detail?id=2929 )
691 // TODO(jungshik): Add a test for the encoding menu to avoid 694 // TODO(jungshik): Add a test for the encoding menu to avoid
692 // regressing it again. 695 // regressing it again.
693 contents_mime_type_ = params.contents_mime_type; 696 if (PageTransition::IsMainFrame(params.transition))
697 contents_mime_type_ = params.contents_mime_type;
694 698
695 NavigationController::LoadCommittedDetails details; 699 NavigationController::LoadCommittedDetails details;
696 if (!controller()->RendererDidNavigate( 700 if (!controller()->RendererDidNavigate(
697 params, 701 params,
698 render_manager_.IsRenderViewInterstitial(rvh), 702 render_manager_.IsRenderViewInterstitial(rvh),
699 &details)) 703 &details))
700 return; // No navigation happened. 704 return; // No navigation happened.
701 705
702 // DO NOT ADD MORE STUFF TO THIS FUNCTION! Your component should either listen 706 // DO NOT ADD MORE STUFF TO THIS FUNCTION! Your component should either listen
703 // for the appropriate notification (best) or you can add it to 707 // for the appropriate notification (best) or you can add it to
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 // The favicon url isn't valid. This means there really isn't a favicon, 1754 // The favicon url isn't valid. This means there really isn't a favicon,
1751 // or the favicon url wasn't obtained before the load started. This assumes 1755 // or the favicon url wasn't obtained before the load started. This assumes
1752 // the later. 1756 // the later.
1753 // TODO(sky): Need a way to set the favicon that doesn't involve generating 1757 // TODO(sky): Need a way to set the favicon that doesn't involve generating
1754 // its url. 1758 // its url.
1755 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); 1759 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer));
1756 } 1760 }
1757 new_url->set_safe_for_autoreplace(true); 1761 new_url->set_safe_for_autoreplace(true);
1758 url_model->Add(new_url); 1762 url_model->Add(new_url);
1759 } 1763 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698