| 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 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/gfx/native_widget_types.h" | 8 #include "base/gfx/native_widget_types.h" |
| 9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
| 10 #include "skia/include/SkBitmap.h" |
| 10 #include "webkit/glue/webplugin.h" | 11 #include "webkit/glue/webplugin.h" |
| 11 #include "skia/include/SkBitmap.h" | 12 #include "webkit/glue/webwidget_delegate.h" |
| 12 | 13 |
| 13 namespace gfx { | 14 namespace gfx { |
| 14 class Rect; | 15 class Rect; |
| 15 class Size; | 16 class Size; |
| 16 } | 17 } |
| 17 namespace IPC { | 18 namespace IPC { |
| 18 class Message; | 19 class Message; |
| 19 } | 20 } |
| 20 | 21 |
| 21 class BackingStore; | 22 class BackingStore; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // Notifies the View that the renderer text selection has changed. | 130 // Notifies the View that the renderer text selection has changed. |
| 130 virtual void SelectionChanged(const std::string& text) { }; | 131 virtual void SelectionChanged(const std::string& text) { }; |
| 131 | 132 |
| 132 // Tells the View to get the text from the selection clipboard and send it | 133 // Tells the View to get the text from the selection clipboard and send it |
| 133 // back to the renderer asynchronously. | 134 // back to the renderer asynchronously. |
| 134 virtual void PasteFromSelectionClipboard() { } | 135 virtual void PasteFromSelectionClipboard() { } |
| 135 | 136 |
| 136 // Allocate a backing store for this view | 137 // Allocate a backing store for this view |
| 137 virtual BackingStore* AllocBackingStore(const gfx::Size& size) = 0; | 138 virtual BackingStore* AllocBackingStore(const gfx::Size& size) = 0; |
| 138 | 139 |
| 140 #if defined(OS_MACOSX) |
| 141 // Display a native control popup menu for WebKit. |
| 142 virtual void ShowPopupWithItems(gfx::Rect bounds, |
| 143 int item_height, |
| 144 int selected_item, |
| 145 const std::vector<WebMenuItem>& items) = 0; |
| 146 #endif |
| 147 |
| 139 void set_activatable(bool activatable) { | 148 void set_activatable(bool activatable) { |
| 140 activatable_ = activatable; | 149 activatable_ = activatable; |
| 141 } | 150 } |
| 142 bool activatable() const { return activatable_; } | 151 bool activatable() const { return activatable_; } |
| 143 | 152 |
| 144 // Subclasses should override this method to do whatever is appropriate to set | 153 // Subclasses should override this method to do whatever is appropriate to set |
| 145 // the custom background for their platform. | 154 // the custom background for their platform. |
| 146 virtual void SetBackground(const SkBitmap& background) { | 155 virtual void SetBackground(const SkBitmap& background) { |
| 147 background_ = background; | 156 background_ = background; |
| 148 } | 157 } |
| 149 const SkBitmap& background() const { return background_; } | 158 const SkBitmap& background() const { return background_; } |
| 150 | 159 |
| 151 protected: | 160 protected: |
| 152 // Interface class only, do not construct. | 161 // Interface class only, do not construct. |
| 153 RenderWidgetHostView() : activatable_(true) {} | 162 RenderWidgetHostView() : activatable_(true) {} |
| 154 | 163 |
| 155 // Whether the window can be activated. Autocomplete popup windows for example | 164 // Whether the window can be activated. Autocomplete popup windows for example |
| 156 // cannot be activated. Default is true. | 165 // cannot be activated. Default is true. |
| 157 bool activatable_; | 166 bool activatable_; |
| 158 | 167 |
| 159 // A custom background to paint behind the web content. This will be tiled | 168 // A custom background to paint behind the web content. This will be tiled |
| 160 // horizontally. Can be null, in which case we fall back to painting white. | 169 // horizontally. Can be null, in which case we fall back to painting white. |
| 161 SkBitmap background_; | 170 SkBitmap background_; |
| 162 | 171 |
| 163 private: | 172 private: |
| 164 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); | 173 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); |
| 165 }; | 174 }; |
| 166 | 175 |
| 167 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 176 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
| OLD | NEW |