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

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

Issue 7894: Set |contents_mime_type| early enough so that the encoding menu is enabled on... (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 "chrome/app/locales/locale_settings.h" 10 #include "chrome/app/locales/locale_settings.h"
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 // are showing an interstitial page. If we are, we should wait until the 677 // are showing an interstitial page. If we are, we should wait until the
678 // real page commits. 678 // real page commits.
679 // 679 //
680 // TODO(brettw) the old code only checked for INTERSTIAL, this new code also 680 // TODO(brettw) the old code only checked for INTERSTIAL, this new code also
681 // checks for LEAVING_INTERSTITIAL mode in the manager. Is this difference 681 // checks for LEAVING_INTERSTITIAL mode in the manager. Is this difference
682 // important? 682 // important?
683 if (!GetSiteInstance()->has_site() && 683 if (!GetSiteInstance()->has_site() &&
684 !render_manager_.showing_interstitial_page()) 684 !render_manager_.showing_interstitial_page())
685 GetSiteInstance()->SetSite(params.url); 685 GetSiteInstance()->SetSite(params.url);
686 686
687 // Need to update MIME type here because it's referred to in
688 // UpdateNavigationCommands() called by RendererDidNavigate() to
689 // determine whether or not to enable the encoding menu.
690 // TODO(jungshik): Add a test for the encoding menu to avoid
691 // regressing it again.
692 contents_mime_type_ = params.contents_mime_type;
693
687 NavigationController::LoadCommittedDetails details; 694 NavigationController::LoadCommittedDetails details;
688 if (!controller()->RendererDidNavigate( 695 if (!controller()->RendererDidNavigate(
689 params, 696 params,
690 render_manager_.IsRenderViewInterstitial(rvh), 697 render_manager_.IsRenderViewInterstitial(rvh),
691 &details)) 698 &details))
692 return; // No navigation happened. 699 return; // No navigation happened.
693 700
694 // DO NOT ADD MORE STUFF TO THIS FUNCTION! Your component should either listen 701 // DO NOT ADD MORE STUFF TO THIS FUNCTION! Your component should either listen
695 // for the appropriate notification (best) or you can add it to 702 // for the appropriate notification (best) or you can add it to
696 // DidNavigateMainFramePostCommit / DidNavigateAnyFramePostCommit (only if 703 // DidNavigateMainFramePostCommit / DidNavigateAnyFramePostCommit (only if
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 GetPasswordManager()->DidNavigate(); 1436 GetPasswordManager()->DidNavigate();
1430 } 1437 }
1431 1438
1432 // The keyword generator uses the navigation entries, so must be called after 1439 // The keyword generator uses the navigation entries, so must be called after
1433 // the commit. 1440 // the commit.
1434 GenerateKeywordIfNecessary(params); 1441 GenerateKeywordIfNecessary(params);
1435 1442
1436 // Allow the new page to set the title again. 1443 // Allow the new page to set the title again.
1437 received_page_title_ = false; 1444 received_page_title_ = false;
1438 1445
1439 // Update contents MIME type of the main webframe.
1440 contents_mime_type_ = params.contents_mime_type;
1441
1442 // Get the favicon, either from history or request it from the net. 1446 // Get the favicon, either from history or request it from the net.
1443 fav_icon_helper_.FetchFavIcon(details.entry->url()); 1447 fav_icon_helper_.FetchFavIcon(details.entry->url());
1444 1448
1445 // Close constrained popups if necessary. 1449 // Close constrained popups if necessary.
1446 MaybeCloseChildWindows(details.previous_url, details.entry->url()); 1450 MaybeCloseChildWindows(details.previous_url, details.entry->url());
1447 1451
1448 // We hide the FindInPage window when the user navigates away, except on 1452 // We hide the FindInPage window when the user navigates away, except on
1449 // reload. 1453 // reload.
1450 if (PageTransition::StripQualifier(params.transition) != 1454 if (PageTransition::StripQualifier(params.transition) !=
1451 PageTransition::RELOAD) 1455 PageTransition::RELOAD)
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1741 // The favicon url isn't valid. This means there really isn't a favicon, 1745 // The favicon url isn't valid. This means there really isn't a favicon,
1742 // or the favicon url wasn't obtained before the load started. This assumes 1746 // or the favicon url wasn't obtained before the load started. This assumes
1743 // the later. 1747 // the later.
1744 // TODO(sky): Need a way to set the favicon that doesn't involve generating 1748 // TODO(sky): Need a way to set the favicon that doesn't involve generating
1745 // its url. 1749 // its url.
1746 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); 1750 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer));
1747 } 1751 }
1748 new_url->set_safe_for_autoreplace(true); 1752 new_url->set_safe_for_autoreplace(true);
1749 url_model->Add(new_url); 1753 url_model->Add(new_url);
1750 } 1754 }
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