summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/dom_view.h
diff options
context:
space:
mode:
authormaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 12:27:03 +0000
committermaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 12:27:03 +0000
commit1eb89e8fbf2d31247f5ceb271d8887a63d4a2bcf (patch)
treeb78be07dbada3ac0f6d2435558e4a6aaba198ffc /chrome/browser/views/dom_view.h
parentea15e98a9353494df754a11fb49f0e4b8c0d4789 (diff)
downloadchromium_src-1eb89e8fbf2d31247f5ceb271d8887a63d4a2bcf.zip
chromium_src-1eb89e8fbf2d31247f5ceb271d8887a63d4a2bcf.tar.gz
chromium_src-1eb89e8fbf2d31247f5ceb271d8887a63d4a2bcf.tar.bz2
Large patch set (159 files total) to cleanup the includes.
- Slightly reduce the size of the generated .lib files ~3%. - Reduce the number of implicit and explicit atl and windows includes. hooray! - Help incremental build by reducing the number of unnecessary included files. - Split some template class in two, one base class for the common code and the specialization that inherits from the base class. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@937 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/dom_view.h')
-rw-r--r--chrome/browser/views/dom_view.h51
1 files changed, 12 insertions, 39 deletions
diff --git a/chrome/browser/views/dom_view.h b/chrome/browser/views/dom_view.h
index 07a5f71..d55914d 100644
--- a/chrome/browser/views/dom_view.h
+++ b/chrome/browser/views/dom_view.h
@@ -30,53 +30,27 @@
// DOMView is a ChromeView that displays the content of a web DOM.
// It should be used with data: URLs.
-#ifndef CHROME_BROWSER_VIEWS_DOM_VIEW_H__
-#define CHROME_BROWSER_VIEWS_DOM_VIEW_H__
+#ifndef CHROME_BROWSER_VIEWS_DOM_VIEW_H_
+#define CHROME_BROWSER_VIEWS_DOM_VIEW_H_
-#include "base/basictypes.h"
-#include "base/scoped_ptr.h"
-#include "base/string_util.h"
-#include "chrome/browser/render_process_host.h"
-#include "chrome/browser/dom_ui/dom_ui_host.h"
#include "chrome/views/hwnd_view.h"
+#include "googleurl/src/gurl.h"
+
+class DOMUIHost;
+class Profile;
+class SiteInstance;
class DOMView : public ChromeViews::HWNDView {
public:
// Construct a DOMView to display the given data: URL.
- explicit DOMView(const GURL& contents)
- : contents_(contents), initialized_(false), host_(NULL) {}
-
- virtual ~DOMView() {
- if (host_) {
- Detach();
- host_->Destroy();
- host_ = NULL;
- }
- }
+ explicit DOMView(const GURL& contents);
+ virtual ~DOMView();
// Initialize the view, causing it to load its contents. This should be
// called once the view has been added to a container.
// If |instance| is not null, then the view will be loaded in the same
// process as the given instance.
- bool Init(Profile* profile, SiteInstance* instance) {
- if (initialized_)
- return true;
- initialized_ = true;
-
- // TODO(timsteele): This should use a separate factory method; e.g
- // a DOMUIHostFactory rather than TabContentsFactory, because DOMView's
- // should only be associated with instances of DOMUIHost.
- TabContentsType type = TabContents::TypeForURL(&contents_);
- TabContents* tab_contents = TabContents::CreateWithType(type,
- GetViewContainer()->GetHWND(), profile, instance);
- host_ = tab_contents->AsDOMUIHost();
- DCHECK(host_);
-
- ChromeViews::HWNDView::Attach(host_->GetContainerHWND());
- host_->SetupController(profile);
- host_->controller()->LoadURL(contents_, PageTransition::START_PAGE);
- return true;
- }
+ bool Init(Profile* profile, SiteInstance* instance);
protected:
DOMUIHost* host_;
@@ -85,8 +59,7 @@ class DOMView : public ChromeViews::HWNDView {
GURL contents_;
bool initialized_;
- DISALLOW_EVIL_CONSTRUCTORS(DOMView);
+ DISALLOW_COPY_AND_ASSIGN(DOMView);
};
-#endif // CHROME_BROWSER_VIEWS_DOM_VIEW_H__
-
+#endif // CHROME_BROWSER_VIEWS_DOM_VIEW_H_