| 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 CHROME_BROWSER_UI_BROWSER_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_WINDOW_H_ |
| 6 #define CHROME_BROWSER_UI_BROWSER_WINDOW_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_WINDOW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
| 10 #include "chrome/browser/lifetime/application_lifetime.h" | 10 #include "chrome/browser/lifetime/application_lifetime.h" |
| 11 #include "chrome/browser/ui/base_window.h" | 11 #include "chrome/browser/ui/base_window.h" |
| 12 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 12 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
| 13 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" | 13 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" |
| 14 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" | 14 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" |
| 15 #include "chrome/browser/ui/zoom/zoom_controller.h" | 15 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| 16 #include "chrome/common/content_settings_types.h" | 16 #include "chrome/common/content_settings_types.h" |
| 17 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 18 #include "webkit/glue/window_open_disposition.h" | 18 #include "webkit/glue/window_open_disposition.h" |
| 19 | 19 |
| 20 class Browser; | 20 class Browser; |
| 21 class BrowserWindowTesting; | 21 class BrowserWindowTesting; |
| 22 class DownloadShelf; | 22 class DownloadShelf; |
| 23 class FindBar; | 23 class FindBar; |
| 24 class GURL; | 24 class GURL; |
| 25 class LocationBar; | 25 class LocationBar; |
| 26 class Profile; | 26 class Profile; |
| 27 class StatusBubble; | 27 class StatusBubble; |
| 28 class TabContents; | 28 class TabContents; |
| 29 typedef TabContents TabContentsWrapper; | |
| 30 class TemplateURL; | 29 class TemplateURL; |
| 31 #if !defined(OS_MACOSX) | 30 #if !defined(OS_MACOSX) |
| 32 class ToolbarView; | 31 class ToolbarView; |
| 33 #endif | 32 #endif |
| 34 | 33 |
| 35 namespace autofill { | 34 namespace autofill { |
| 36 class PasswordGenerator; | 35 class PasswordGenerator; |
| 37 } | 36 } |
| 38 namespace content { | 37 namespace content { |
| 39 class WebContents; | 38 class WebContents; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 159 |
| 161 // Tries to focus the location bar. Clears the window focus (to avoid | 160 // Tries to focus the location bar. Clears the window focus (to avoid |
| 162 // inconsistent state) if this fails. | 161 // inconsistent state) if this fails. |
| 163 virtual void SetFocusToLocationBar(bool select_all) = 0; | 162 virtual void SetFocusToLocationBar(bool select_all) = 0; |
| 164 | 163 |
| 165 // Informs the view whether or not a load is in progress for the current tab. | 164 // Informs the view whether or not a load is in progress for the current tab. |
| 166 // The view can use this notification to update the reload/stop button. | 165 // The view can use this notification to update the reload/stop button. |
| 167 virtual void UpdateReloadStopState(bool is_loading, bool force) = 0; | 166 virtual void UpdateReloadStopState(bool is_loading, bool force) = 0; |
| 168 | 167 |
| 169 // Updates the toolbar with the state for the specified |contents|. | 168 // Updates the toolbar with the state for the specified |contents|. |
| 170 virtual void UpdateToolbar(TabContentsWrapper* contents, | 169 virtual void UpdateToolbar(TabContents* contents, |
| 171 bool should_restore_state) = 0; | 170 bool should_restore_state) = 0; |
| 172 | 171 |
| 173 // Focuses the toolbar (for accessibility). | 172 // Focuses the toolbar (for accessibility). |
| 174 virtual void FocusToolbar() = 0; | 173 virtual void FocusToolbar() = 0; |
| 175 | 174 |
| 176 // Focuses the app menu like it was a menu bar. | 175 // Focuses the app menu like it was a menu bar. |
| 177 // | 176 // |
| 178 // Not used on the Mac, which has a "normal" menu bar. | 177 // Not used on the Mac, which has a "normal" menu bar. |
| 179 virtual void FocusAppMenu() = 0; | 178 virtual void FocusAppMenu() = 0; |
| 180 | 179 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 virtual void ShowPageInfo(Profile* profile, | 284 virtual void ShowPageInfo(Profile* profile, |
| 286 const GURL& url, | 285 const GURL& url, |
| 287 const content::SSLStatus& ssl, | 286 const content::SSLStatus& ssl, |
| 288 bool show_history) = 0; | 287 bool show_history) = 0; |
| 289 | 288 |
| 290 // Shows the website settings using the specified information. |url| is the | 289 // Shows the website settings using the specified information. |url| is the |
| 291 // url of the page/frame the info applies to, |ssl| is the SSL information for | 290 // url of the page/frame the info applies to, |ssl| is the SSL information for |
| 292 // that page/frame. If |show_history| is true, a section showing how many | 291 // that page/frame. If |show_history| is true, a section showing how many |
| 293 // times that URL has been visited is added to the page info. | 292 // times that URL has been visited is added to the page info. |
| 294 virtual void ShowWebsiteSettings(Profile* profile, | 293 virtual void ShowWebsiteSettings(Profile* profile, |
| 295 TabContentsWrapper* tab_contents_wrapper, | 294 TabContents* tab_contents, |
| 296 const GURL& url, | 295 const GURL& url, |
| 297 const content::SSLStatus& ssl, | 296 const content::SSLStatus& ssl, |
| 298 bool show_history) = 0; | 297 bool show_history) = 0; |
| 299 | 298 |
| 300 // Shows the app menu (for accessibility). | 299 // Shows the app menu (for accessibility). |
| 301 virtual void ShowAppMenu() = 0; | 300 virtual void ShowAppMenu() = 0; |
| 302 | 301 |
| 303 // Allows the BrowserWindow object to handle the specified keyboard event | 302 // Allows the BrowserWindow object to handle the specified keyboard event |
| 304 // before sending it to the renderer. | 303 // before sending it to the renderer. |
| 305 // Returns true if the |event| was handled. Otherwise, if the |event| would | 304 // Returns true if the |event| was handled. Otherwise, if the |event| would |
| 306 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, | 305 // be handled in HandleKeyboardEvent() method as a normal keyboard shortcut, |
| 307 // |*is_keyboard_shortcut| should be set to true. | 306 // |*is_keyboard_shortcut| should be set to true. |
| 308 virtual bool PreHandleKeyboardEvent( | 307 virtual bool PreHandleKeyboardEvent( |
| 309 const content::NativeWebKeyboardEvent& event, | 308 const content::NativeWebKeyboardEvent& event, |
| 310 bool* is_keyboard_shortcut) = 0; | 309 bool* is_keyboard_shortcut) = 0; |
| 311 | 310 |
| 312 // Allows the BrowserWindow object to handle the specified keyboard event, | 311 // Allows the BrowserWindow object to handle the specified keyboard event, |
| 313 // if the renderer did not process it. | 312 // if the renderer did not process it. |
| 314 virtual void HandleKeyboardEvent( | 313 virtual void HandleKeyboardEvent( |
| 315 const content::NativeWebKeyboardEvent& event) = 0; | 314 const content::NativeWebKeyboardEvent& event) = 0; |
| 316 | 315 |
| 317 // Shows the create web app shortcut dialog box. | 316 // Shows the create web app shortcut dialog box. |
| 318 virtual void ShowCreateWebAppShortcutsDialog( | 317 virtual void ShowCreateWebAppShortcutsDialog(TabContents* tab_contents) = 0; |
| 319 TabContentsWrapper* tab_contents) = 0; | |
| 320 | 318 |
| 321 // Shows the create chrome app shortcut dialog box. | 319 // Shows the create chrome app shortcut dialog box. |
| 322 virtual void ShowCreateChromeAppShortcutsDialog(Profile* profile, | 320 virtual void ShowCreateChromeAppShortcutsDialog(Profile* profile, |
| 323 const extensions::Extension* app) = 0; | 321 const extensions::Extension* app) = 0; |
| 324 | 322 |
| 325 | 323 |
| 326 // Clipboard commands applied to the whole browser window. | 324 // Clipboard commands applied to the whole browser window. |
| 327 virtual void Cut() = 0; | 325 virtual void Cut() = 0; |
| 328 virtual void Copy() = 0; | 326 virtual void Copy() = 0; |
| 329 virtual void Paste() = 0; | 327 virtual void Paste() = 0; |
| 330 | 328 |
| 331 #if defined(OS_MACOSX) | 329 #if defined(OS_MACOSX) |
| 332 // Opens the tabpose view. | 330 // Opens the tabpose view. |
| 333 virtual void OpenTabpose() = 0; | 331 virtual void OpenTabpose() = 0; |
| 334 | 332 |
| 335 // Sets the presentation mode for the window. If the window is not already in | 333 // Sets the presentation mode for the window. If the window is not already in |
| 336 // fullscreen, also enters fullscreen mode. | 334 // fullscreen, also enters fullscreen mode. |
| 337 virtual void EnterPresentationMode( | 335 virtual void EnterPresentationMode( |
| 338 const GURL& url, | 336 const GURL& url, |
| 339 FullscreenExitBubbleType bubble_type) = 0; | 337 FullscreenExitBubbleType bubble_type) = 0; |
| 340 virtual void ExitPresentationMode() = 0; | 338 virtual void ExitPresentationMode() = 0; |
| 341 virtual bool InPresentationMode() = 0; | 339 virtual bool InPresentationMode() = 0; |
| 342 #endif | 340 #endif |
| 343 | 341 |
| 344 // Invoked when instant's tab contents should be shown. | 342 // Invoked when instant's tab contents should be shown. |
| 345 virtual void ShowInstant(TabContentsWrapper* preview) = 0; | 343 virtual void ShowInstant(TabContents* preview) = 0; |
| 346 | 344 |
| 347 // Invoked when the instant's tab contents should be hidden. | 345 // Invoked when the instant's tab contents should be hidden. |
| 348 virtual void HideInstant() = 0; | 346 virtual void HideInstant() = 0; |
| 349 | 347 |
| 350 // Returns the desired bounds for instant in screen coordinates. Note that if | 348 // Returns the desired bounds for instant in screen coordinates. Note that if |
| 351 // instant isn't currently visible this returns the bounds instant would be | 349 // instant isn't currently visible this returns the bounds instant would be |
| 352 // placed at. | 350 // placed at. |
| 353 virtual gfx::Rect GetInstantBounds() = 0; | 351 virtual gfx::Rect GetInstantBounds() = 0; |
| 354 | 352 |
| 355 // Return the correct disposition for a popup window based on |bounds|. | 353 // Return the correct disposition for a popup window based on |bounds|. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 422 |
| 425 // Returns the ToolbarView. | 423 // Returns the ToolbarView. |
| 426 virtual ToolbarView* GetToolbarView() const = 0; | 424 virtual ToolbarView* GetToolbarView() const = 0; |
| 427 #endif | 425 #endif |
| 428 | 426 |
| 429 protected: | 427 protected: |
| 430 virtual ~BrowserWindowTesting() {} | 428 virtual ~BrowserWindowTesting() {} |
| 431 }; | 429 }; |
| 432 | 430 |
| 433 #endif // CHROME_BROWSER_UI_BROWSER_WINDOW_H_ | 431 #endif // CHROME_BROWSER_UI_BROWSER_WINDOW_H_ |
| OLD | NEW |