| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // a continuous size operation completes. This allows for smoother | 57 // a continuous size operation completes. This allows for smoother |
| 58 // resizing performance during interactive resizes and animations. | 58 // resizing performance during interactive resizes and animations. |
| 59 void SetFastResize(bool fast_resize); | 59 void SetFastResize(bool fast_resize); |
| 60 | 60 |
| 61 // Called when the WebContents is focused. | 61 // Called when the WebContents is focused. |
| 62 // TODO(beng): This view should become a WebContentsViewObserver when a | 62 // TODO(beng): This view should become a WebContentsViewObserver when a |
| 63 // WebContents is attached, and not rely on the delegate to | 63 // WebContents is attached, and not rely on the delegate to |
| 64 // forward this notification. | 64 // forward this notification. |
| 65 void OnWebContentsFocused(content::WebContents* web_contents); | 65 void OnWebContentsFocused(content::WebContents* web_contents); |
| 66 | 66 |
| 67 // When used to host UI, we need to explicitly allow accelerators to be |
| 68 // processed. Default is false. |
| 69 void set_allow_accelerators(bool allow_accelerators) { |
| 70 allow_accelerators_ = allow_accelerators; |
| 71 } |
| 72 |
| 67 // Overridden from View: | 73 // Overridden from View: |
| 68 virtual std::string GetClassName() const OVERRIDE; | 74 virtual std::string GetClassName() const OVERRIDE; |
| 69 | 75 |
| 70 private: | 76 private: |
| 71 // Overridden from View: | 77 // Overridden from View: |
| 72 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 78 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
| 73 virtual void ViewHierarchyChanged(bool is_add, | 79 virtual void ViewHierarchyChanged(bool is_add, |
| 74 View* parent, | 80 View* parent, |
| 75 View* child) OVERRIDE; | 81 View* child) OVERRIDE; |
| 76 virtual bool SkipDefaultKeyEventProcessing( | 82 virtual bool SkipDefaultKeyEventProcessing( |
| (...skipping 17 matching lines...) Expand all Loading... |
| 94 | 100 |
| 95 void RenderViewHostChanged(content::RenderViewHost* old_host, | 101 void RenderViewHostChanged(content::RenderViewHost* old_host, |
| 96 content::RenderViewHost* new_host); | 102 content::RenderViewHost* new_host); |
| 97 void WebContentsDestroyed(content::WebContents* web_contents); | 103 void WebContentsDestroyed(content::WebContents* web_contents); |
| 98 | 104 |
| 99 NativeViewHost* wcv_holder_; | 105 NativeViewHost* wcv_holder_; |
| 100 scoped_ptr<content::WebContents> wc_owner_; | 106 scoped_ptr<content::WebContents> wc_owner_; |
| 101 content::WebContents* web_contents_; | 107 content::WebContents* web_contents_; |
| 102 content::BrowserContext* browser_context_; | 108 content::BrowserContext* browser_context_; |
| 103 content::NotificationRegistrar registrar_; | 109 content::NotificationRegistrar registrar_; |
| 110 bool allow_accelerators_; |
| 104 | 111 |
| 105 DISALLOW_COPY_AND_ASSIGN(WebView); | 112 DISALLOW_COPY_AND_ASSIGN(WebView); |
| 106 }; | 113 }; |
| 107 | 114 |
| 108 } // namespace views | 115 } // namespace views |
| 109 | 116 |
| 110 #endif // UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ | 117 #endif // UI_VIEWS_CONTROLS_WEBVIEW_WEBVIEW_H_ |
| OLD | NEW |