| 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_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "app/gfx/native_widget_types.h" | 10 #include "app/gfx/native_widget_types.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // Shows the page info using the specified information. | 215 // Shows the page info using the specified information. |
| 216 // |url| is the url of the page/frame the info applies to, |ssl| is the SSL | 216 // |url| is the url of the page/frame the info applies to, |ssl| is the SSL |
| 217 // information for that page/frame. If |show_history| is true, a section | 217 // information for that page/frame. If |show_history| is true, a section |
| 218 // showing how many times that URL has been visited is added to the page info. | 218 // showing how many times that URL has been visited is added to the page info. |
| 219 virtual void ShowPageInfo(Profile* profile, | 219 virtual void ShowPageInfo(Profile* profile, |
| 220 const GURL& url, | 220 const GURL& url, |
| 221 const NavigationEntry::SSLStatus& ssl, | 221 const NavigationEntry::SSLStatus& ssl, |
| 222 bool show_history) { | 222 bool show_history) { |
| 223 } | 223 } |
| 224 | 224 |
| 225 // Returns whether the event is a reserved keyboard shortcut that should not | 225 // Allows delegates to handle keyboard events before sending to the renderer. |
| 226 // be sent to the renderer. | 226 // Returns true if the |event| was handled. Otherwise, if the |event| would be |
| 227 virtual bool IsReservedAccelerator(const NativeWebKeyboardEvent& event) { | 227 // handled in HandleKeyboardEvent() method as a normal keyboard shortcut, |
| 228 // |*is_keyboard_shortcut| should be set to true. |
| 229 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| 230 bool* is_keyboard_shortcut) { |
| 228 return false; | 231 return false; |
| 229 } | 232 } |
| 230 | 233 |
| 231 // Allows delegates to handle unhandled keyboard messages coming back from | 234 // Allows delegates to handle unhandled keyboard messages coming back from |
| 232 // the renderer. | 235 // the renderer. |
| 233 // Returns true if the keyboard message was handled. | 236 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {} |
| 234 virtual bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | |
| 235 return false; | |
| 236 } | |
| 237 | 237 |
| 238 // Shows the repost form confirmation dialog box. | 238 // Shows the repost form confirmation dialog box. |
| 239 virtual void ShowRepostFormWarningDialog(TabContents* tab_contents) {} | 239 virtual void ShowRepostFormWarningDialog(TabContents* tab_contents) {} |
| 240 | 240 |
| 241 // Allows delegate to override navigation to the history entries. | 241 // Allows delegate to override navigation to the history entries. |
| 242 // Returns true to allow TabContents to continue with the default processing. | 242 // Returns true to allow TabContents to continue with the default processing. |
| 243 virtual bool OnGoToEntryOffset(int offset) { | 243 virtual bool OnGoToEntryOffset(int offset) { |
| 244 return true; | 244 return true; |
| 245 } | 245 } |
| 246 | 246 |
| 247 // Returns whether this tab contents should add navigations to history. | 247 // Returns whether this tab contents should add navigations to history. |
| 248 virtual bool ShouldAddNavigationsToHistory() const { return true; } | 248 virtual bool ShouldAddNavigationsToHistory() const { return true; } |
| 249 | 249 |
| 250 // Notification when web app info data is available | 250 // Notification when web app info data is available |
| 251 virtual void OnDidGetApplicationInfo(TabContents* tab_contents, | 251 virtual void OnDidGetApplicationInfo(TabContents* tab_contents, |
| 252 int32 page_id) { | 252 int32 page_id) { |
| 253 } | 253 } |
| 254 | 254 |
| 255 // Returns the browser in which the tab contents is being displayed. | 255 // Returns the browser in which the tab contents is being displayed. |
| 256 virtual Browser* GetBrowser() { return NULL; } | 256 virtual Browser* GetBrowser() { return NULL; } |
| 257 | 257 |
| 258 // Returns the widget framing the view containing the tab contents. | 258 // Returns the widget framing the view containing the tab contents. |
| 259 virtual gfx::NativeWindow GetFrameNativeWindow() { return NULL; } | 259 virtual gfx::NativeWindow GetFrameNativeWindow() { return NULL; } |
| 260 | 260 |
| 261 protected: | 261 protected: |
| 262 ~TabContentsDelegate() {} | 262 ~TabContentsDelegate() {} |
| 263 }; | 263 }; |
| 264 | 264 |
| 265 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 265 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
| OLD | NEW |