diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-17 23:30:48 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-17 23:30:48 +0000 |
commit | a906995f1f4fa1d9409cfb03be78307f5c18960a (patch) | |
tree | ce75c5777618cf559e6e9d83fdfba8ea42ee49e9 | |
parent | a9830b5b2fa67fa28fe52300b7c4858d3a1ae5bd (diff) | |
download | chromium_src-a906995f1f4fa1d9409cfb03be78307f5c18960a.zip chromium_src-a906995f1f4fa1d9409cfb03be78307f5c18960a.tar.gz chromium_src-a906995f1f4fa1d9409cfb03be78307f5c18960a.tar.bz2 |
Expand the comment explaining WebContents, and clean up example code.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/11613004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173565 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/public/browser/web_contents.h | 21 | ||||
-rw-r--r-- | content/shell/shell.cc | 4 |
2 files changed, 22 insertions, 3 deletions
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h index ceda85d..226d36b 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h @@ -45,7 +45,26 @@ class WebContentsDelegate; class WebContentsView; struct RendererPreferences; -// Describes what goes in the main content area of a tab. +// WebContents is the core class in content/. A WebContents renders web content +// (usually HTML) in a rectangular area. +// +// Instantiating one is simple: +// scoped_ptr<content::WebContents> web_contents( +// content::WebContents::Create( +// content::WebContents::CreateParams(browser_context))); +// gfx::NativeView view = web_contents->GetView()->GetNativeView(); +// // |view| is an HWND, NSView*, GtkWidget*, etc.; insert it into the view +// // hierarchy wherever it needs to go. +// +// That's it; go to your kitchen, grab a scone, and chill. WebContents will do +// all the multi-process stuff behind the scenes. More details are at +// http://www.chromium.org/developers/design-documents/multi-process-architecture . +// +// Each WebContents has exactly one NavigationController; each +// NavigationController belongs to one WebContents. The NavigationController can +// be obtained from GetController(), and is used to load URLs into the +// WebContents, navigate it backwards/forwards, etc. See navigation_controller.h +// for more details. class WebContents : public PageNavigator, public IPC::Sender, public base::SupportsUserData { diff --git a/content/shell/shell.cc b/content/shell/shell.cc index 739630b..45f9660 100644 --- a/content/shell/shell.cc +++ b/content/shell/shell.cc @@ -129,8 +129,8 @@ void Shell::LoadURL(const GURL& url) { web_contents_->GetController().LoadURL( url, Referrer(), - static_cast<PageTransition>( - PAGE_TRANSITION_TYPED | PAGE_TRANSITION_FROM_ADDRESS_BAR), + PageTransitionFromInt(PAGE_TRANSITION_TYPED | + PAGE_TRANSITION_FROM_ADDRESS_BAR), std::string()); web_contents_->Focus(); } |