OLD | NEW |
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 // DOMView is a ChromeView that displays the content of a web DOM. | 5 // DOMView is a ChromeView that displays the content of a web DOM. |
6 // It should be used with data: URLs. | 6 // It should be used with data: URLs. |
7 | 7 |
8 #ifndef CHROME_BROWSER_VIEWS_DOM_VIEW_H_ | 8 #ifndef CHROME_BROWSER_VIEWS_DOM_VIEW_H_ |
9 #define CHROME_BROWSER_VIEWS_DOM_VIEW_H_ | 9 #define CHROME_BROWSER_VIEWS_DOM_VIEW_H_ |
10 | 10 |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
13 #include "views/controls/hwnd_view.h" | 13 #include "views/controls/native/native_view_host.h" |
14 #include "views/event.h" | 14 #include "views/event.h" |
15 | 15 |
16 class Profile; | 16 class Profile; |
17 class SiteInstance; | 17 class SiteInstance; |
18 class TabContents; | 18 class TabContents; |
19 | 19 |
20 class DOMView : public views::HWNDView { | 20 class DOMView : public views::NativeViewHost { |
21 public: | 21 public: |
22 // Construct a DOMView to display the given data: URL. | 22 // Construct a DOMView to display the given data: URL. |
23 explicit DOMView(); | 23 explicit DOMView(); |
24 virtual ~DOMView(); | 24 virtual ~DOMView(); |
25 | 25 |
26 // Initialize the view, creating the contents. This should be | 26 // Initialize the view, creating the contents. This should be |
27 // called once the view has been added to a container. | 27 // called once the view has been added to a container. |
28 // | 28 // |
29 // If |instance| is not null, then the view will be loaded in the same | 29 // If |instance| is not null, then the view will be loaded in the same |
30 // process as the given instance. | 30 // process as the given instance. |
31 bool Init(Profile* profile, SiteInstance* instance); | 31 bool Init(Profile* profile, SiteInstance* instance); |
32 | 32 |
33 // Loads the given URL into the page. You must have previously called Init(). | 33 // Loads the given URL into the page. You must have previously called Init(). |
34 void LoadURL(const GURL& url); | 34 void LoadURL(const GURL& url); |
35 | 35 |
36 protected: | 36 protected: |
37 // Overridden from View. | 37 // Overridden from View. |
38 virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e); | 38 virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e); |
39 | 39 |
40 scoped_ptr<TabContents> tab_contents_; | 40 scoped_ptr<TabContents> tab_contents_; |
41 | 41 |
42 private: | 42 private: |
43 bool initialized_; | 43 bool initialized_; |
44 | 44 |
45 DISALLOW_COPY_AND_ASSIGN(DOMView); | 45 DISALLOW_COPY_AND_ASSIGN(DOMView); |
46 }; | 46 }; |
47 | 47 |
48 #endif // CHROME_BROWSER_VIEWS_DOM_VIEW_H_ | 48 #endif // CHROME_BROWSER_VIEWS_DOM_VIEW_H_ |
OLD | NEW |