Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ | 5 #ifndef UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ |
| 6 #define UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ | 6 #define UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 | 66 |
| 67 // When used to host UI, we need to explicitly allow accelerators to be | 67 // When used to host UI, we need to explicitly allow accelerators to be |
| 68 // processed. Default is false. | 68 // processed. Default is false. |
| 69 void set_allow_accelerators(bool allow_accelerators) { | 69 void set_allow_accelerators(bool allow_accelerators) { |
| 70 allow_accelerators_ = allow_accelerators; | 70 allow_accelerators_ = allow_accelerators; |
| 71 } | 71 } |
| 72 | 72 |
| 73 // Overridden from View: | 73 // Overridden from View: |
| 74 virtual std::string GetClassName() const OVERRIDE; | 74 virtual std::string GetClassName() const OVERRIDE; |
| 75 | 75 |
| 76 protected: | |
| 77 // Added so it can be overriden by a Test/Mock class, allowing us | |
| 78 // to create a TestWebContents instead when running unit tests. | |
| 79 virtual content::WebContents* CreateWebContents( | |
|
Ben Goodger (Google)
2012/05/01 16:57:42
So, I'm generally pretty leery of subclassing of c
rkc
2012/05/02 00:51:03
Done.
rkc
2012/05/02 00:51:03
Done.
| |
| 80 content::BrowserContext* browser_context, | |
| 81 content::SiteInstance* site_instance); | |
| 82 | |
| 76 private: | 83 private: |
| 77 // Overridden from View: | 84 // Overridden from View: |
| 78 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 85 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
| 79 virtual void ViewHierarchyChanged(bool is_add, | 86 virtual void ViewHierarchyChanged(bool is_add, |
| 80 View* parent, | 87 View* parent, |
| 81 View* child) OVERRIDE; | 88 View* child) OVERRIDE; |
| 82 virtual bool SkipDefaultKeyEventProcessing( | 89 virtual bool SkipDefaultKeyEventProcessing( |
| 83 const views::KeyEvent& event) OVERRIDE; | 90 const views::KeyEvent& event) OVERRIDE; |
| 84 virtual bool IsFocusable() const OVERRIDE; | 91 virtual bool IsFocusable() const OVERRIDE; |
| 85 virtual void OnFocus() OVERRIDE; | 92 virtual void OnFocus() OVERRIDE; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 107 content::WebContents* web_contents_; | 114 content::WebContents* web_contents_; |
| 108 content::BrowserContext* browser_context_; | 115 content::BrowserContext* browser_context_; |
| 109 content::NotificationRegistrar registrar_; | 116 content::NotificationRegistrar registrar_; |
| 110 bool allow_accelerators_; | 117 bool allow_accelerators_; |
| 111 | 118 |
| 112 DISALLOW_COPY_AND_ASSIGN(WebView); | 119 DISALLOW_COPY_AND_ASSIGN(WebView); |
| 113 }; | 120 }; |
| 114 | 121 |
| 115 } // namespace views | 122 } // namespace views |
| 116 | 123 |
| 117 #endif // UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ | 124 #endif // UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ |
| OLD | NEW |