| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_VIEWS_FRAME_BROWSER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // command id. This can be used to provide menu item shortcut hints etc. | 176 // command id. This can be used to provide menu item shortcut hints etc. |
| 177 // Returns true if an accelerator was found for the specified |cmd_id|, false | 177 // Returns true if an accelerator was found for the specified |cmd_id|, false |
| 178 // otherwise. | 178 // otherwise. |
| 179 bool GetAccelerator(int cmd_id, menus::Accelerator* accelerator); | 179 bool GetAccelerator(int cmd_id, menus::Accelerator* accelerator); |
| 180 | 180 |
| 181 // Shows the next app-modal dialog box, if there is one to be shown, or moves | 181 // Shows the next app-modal dialog box, if there is one to be shown, or moves |
| 182 // an existing showing one to the front. Returns true if one was shown or | 182 // an existing showing one to the front. Returns true if one was shown or |
| 183 // activated, false if none was shown. | 183 // activated, false if none was shown. |
| 184 bool ActivateAppModalDialog() const; | 184 bool ActivateAppModalDialog() const; |
| 185 | 185 |
| 186 // Returns the selected TabContents. Used by our NonClientView's | 186 // Returns the selected TabContents[Wrapper]. Used by our NonClientView's |
| 187 // TabIconView::TabContentsProvider implementations. | 187 // TabIconView::TabContentsProvider implementations. |
| 188 // TODO(beng): exposing this here is a bit bogus, since it's only used to | 188 // TODO(beng): exposing this here is a bit bogus, since it's only used to |
| 189 // determine loading state. It'd be nicer if we could change this to be | 189 // determine loading state. It'd be nicer if we could change this to be |
| 190 // bool IsSelectedTabLoading() const; or something like that. We could even | 190 // bool IsSelectedTabLoading() const; or something like that. We could even |
| 191 // move it to a WindowDelegate subclass. | 191 // move it to a WindowDelegate subclass. |
| 192 TabContents* GetSelectedTabContents() const; | 192 TabContents* GetSelectedTabContents() const; |
| 193 TabContentsWrapper* GetSelectedTabContentsWrapper() const; |
| 193 | 194 |
| 194 // Retrieves the icon to use in the frame to indicate an OTR window. | 195 // Retrieves the icon to use in the frame to indicate an OTR window. |
| 195 SkBitmap GetOTRAvatarIcon(); | 196 SkBitmap GetOTRAvatarIcon(); |
| 196 | 197 |
| 197 #if defined(OS_WIN) | 198 #if defined(OS_WIN) |
| 198 // Called right before displaying the system menu to allow the BrowserView | 199 // Called right before displaying the system menu to allow the BrowserView |
| 199 // to add or delete entries. | 200 // to add or delete entries. |
| 200 void PrepareToRunSystemMenu(HMENU menu); | 201 void PrepareToRunSystemMenu(HMENU menu); |
| 201 #endif | 202 #endif |
| 202 | 203 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 virtual void UpdateDevTools(); | 257 virtual void UpdateDevTools(); |
| 257 virtual void UpdateLoadingAnimations(bool should_animate); | 258 virtual void UpdateLoadingAnimations(bool should_animate); |
| 258 virtual void SetStarredState(bool is_starred); | 259 virtual void SetStarredState(bool is_starred); |
| 259 virtual gfx::Rect GetRestoredBounds() const; | 260 virtual gfx::Rect GetRestoredBounds() const; |
| 260 virtual bool IsMaximized() const; | 261 virtual bool IsMaximized() const; |
| 261 virtual void SetFullscreen(bool fullscreen); | 262 virtual void SetFullscreen(bool fullscreen); |
| 262 virtual bool IsFullscreen() const; | 263 virtual bool IsFullscreen() const; |
| 263 virtual LocationBar* GetLocationBar() const; | 264 virtual LocationBar* GetLocationBar() const; |
| 264 virtual void SetFocusToLocationBar(bool select_all); | 265 virtual void SetFocusToLocationBar(bool select_all); |
| 265 virtual void UpdateReloadStopState(bool is_loading, bool force); | 266 virtual void UpdateReloadStopState(bool is_loading, bool force); |
| 266 virtual void UpdateToolbar(TabContents* contents, bool should_restore_state); | 267 virtual void UpdateToolbar(TabContentsWrapper* contents, |
| 268 bool should_restore_state); |
| 267 virtual void FocusToolbar(); | 269 virtual void FocusToolbar(); |
| 268 virtual void FocusAppMenu(); | 270 virtual void FocusAppMenu(); |
| 269 virtual void FocusBookmarksToolbar(); | 271 virtual void FocusBookmarksToolbar(); |
| 270 virtual void FocusChromeOSStatus() {} | 272 virtual void FocusChromeOSStatus() {} |
| 271 virtual void RotatePaneFocus(bool forwards); | 273 virtual void RotatePaneFocus(bool forwards); |
| 272 virtual void DestroyBrowser(); | 274 virtual void DestroyBrowser(); |
| 273 virtual bool IsBookmarkBarVisible() const; | 275 virtual bool IsBookmarkBarVisible() const; |
| 274 virtual bool IsBookmarkBarAnimating() const; | 276 virtual bool IsBookmarkBarAnimating() const; |
| 275 virtual bool IsToolbarVisible() const; | 277 virtual bool IsToolbarVisible() const; |
| 276 virtual void DisableInactiveFrame(); | 278 virtual void DisableInactiveFrame(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 virtual views::View* GetTabContentsContainerView() const; | 332 virtual views::View* GetTabContentsContainerView() const; |
| 331 virtual views::View* GetSidebarContainerView() const; | 333 virtual views::View* GetSidebarContainerView() const; |
| 332 virtual ToolbarView* GetToolbarView() const; | 334 virtual ToolbarView* GetToolbarView() const; |
| 333 | 335 |
| 334 // Overridden from NotificationObserver: | 336 // Overridden from NotificationObserver: |
| 335 virtual void Observe(NotificationType type, | 337 virtual void Observe(NotificationType type, |
| 336 const NotificationSource& source, | 338 const NotificationSource& source, |
| 337 const NotificationDetails& details); | 339 const NotificationDetails& details); |
| 338 | 340 |
| 339 // Overridden from TabStripModelObserver: | 341 // Overridden from TabStripModelObserver: |
| 340 virtual void TabDetachedAt(TabContents* contents, int index); | 342 virtual void TabDetachedAt(TabContentsWrapper* contents, int index); |
| 341 virtual void TabDeselectedAt(TabContents* contents, int index); | 343 virtual void TabDeselectedAt(TabContentsWrapper* contents, int index); |
| 342 virtual void TabSelectedAt(TabContents* old_contents, | 344 virtual void TabSelectedAt(TabContentsWrapper* old_contents, |
| 343 TabContents* new_contents, | 345 TabContentsWrapper* new_contents, |
| 344 int index, | 346 int index, |
| 345 bool user_gesture); | 347 bool user_gesture); |
| 346 virtual void TabReplacedAt(TabContents* old_contents, | 348 virtual void TabReplacedAt(TabContentsWrapper* old_contents, |
| 347 TabContents* new_contents, | 349 TabContentsWrapper* new_contents, |
| 348 int index); | 350 int index); |
| 349 virtual void TabStripEmpty(); | 351 virtual void TabStripEmpty(); |
| 350 | 352 |
| 351 // Overridden from menus::SimpleMenuModel::Delegate: | 353 // Overridden from menus::SimpleMenuModel::Delegate: |
| 352 virtual bool IsCommandIdChecked(int command_id) const; | 354 virtual bool IsCommandIdChecked(int command_id) const; |
| 353 virtual bool IsCommandIdEnabled(int command_id) const; | 355 virtual bool IsCommandIdEnabled(int command_id) const; |
| 354 virtual bool GetAcceleratorForCommandId(int command_id, | 356 virtual bool GetAcceleratorForCommandId(int command_id, |
| 355 menus::Accelerator* accelerator); | 357 menus::Accelerator* accelerator); |
| 356 virtual bool IsLabelForCommandIdDynamic(int command_id) const; | 358 virtual bool IsLabelForCommandIdDynamic(int command_id) const; |
| 357 virtual string16 GetLabelForCommandId(int command_id) const; | 359 virtual string16 GetLabelForCommandId(int command_id) const; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 // Returns the BrowserViewLayout. | 437 // Returns the BrowserViewLayout. |
| 436 BrowserViewLayout* GetBrowserViewLayout() const; | 438 BrowserViewLayout* GetBrowserViewLayout() const; |
| 437 | 439 |
| 438 // Layout the Status Bubble. | 440 // Layout the Status Bubble. |
| 439 void LayoutStatusBubble(); | 441 void LayoutStatusBubble(); |
| 440 | 442 |
| 441 // Prepare to show the Bookmark Bar for the specified TabContents. Returns | 443 // Prepare to show the Bookmark Bar for the specified TabContents. Returns |
| 442 // true if the Bookmark Bar can be shown (i.e. it's supported for this | 444 // true if the Bookmark Bar can be shown (i.e. it's supported for this |
| 443 // Browser type) and there should be a subsequent re-layout to show it. | 445 // Browser type) and there should be a subsequent re-layout to show it. |
| 444 // |contents| can be NULL. | 446 // |contents| can be NULL. |
| 445 bool MaybeShowBookmarkBar(TabContents* contents); | 447 bool MaybeShowBookmarkBar(TabContentsWrapper* contents); |
| 446 | 448 |
| 447 // Prepare to show an Info Bar for the specified TabContents. Returns true | 449 // Prepare to show an Info Bar for the specified TabContents. Returns true |
| 448 // if there is an Info Bar to show and one is supported for this Browser | 450 // if there is an Info Bar to show and one is supported for this Browser |
| 449 // type, and there should be a subsequent re-layout to show it. | 451 // type, and there should be a subsequent re-layout to show it. |
| 450 // |contents| can be NULL. | 452 // |contents| can be NULL. |
| 451 bool MaybeShowInfoBar(TabContents* contents); | 453 bool MaybeShowInfoBar(TabContentsWrapper* contents); |
| 452 | 454 |
| 453 // Updates sidebar UI according to the current tab and sidebar state. | 455 // Updates sidebar UI according to the current tab and sidebar state. |
| 454 void UpdateSidebar(); | 456 void UpdateSidebar(); |
| 455 // Displays active sidebar linked to the |tab_contents| or hides sidebar UI, | 457 // Displays active sidebar linked to the |tab_contents| or hides sidebar UI, |
| 456 // if there's no such sidebar. | 458 // if there's no such sidebar. |
| 457 void UpdateSidebarForContents(TabContents* tab_contents); | 459 void UpdateSidebarForContents(TabContentsWrapper* tab_contents); |
| 458 | 460 |
| 459 // Updated devtools window for given contents. | 461 // Updated devtools window for given contents. |
| 460 void UpdateDevToolsForContents(TabContents* tab_contents); | 462 void UpdateDevToolsForContents(TabContentsWrapper* tab_contents); |
| 461 | 463 |
| 462 // Updates various optional child Views, e.g. Bookmarks Bar, Info Bar or the | 464 // Updates various optional child Views, e.g. Bookmarks Bar, Info Bar or the |
| 463 // Download Shelf in response to a change notification from the specified | 465 // Download Shelf in response to a change notification from the specified |
| 464 // |contents|. |contents| can be NULL. In this case, all optional UI will be | 466 // |contents|. |contents| can be NULL. In this case, all optional UI will be |
| 465 // removed. | 467 // removed. |
| 466 void UpdateUIForContents(TabContents* contents); | 468 void UpdateUIForContents(TabContentsWrapper* contents); |
| 467 | 469 |
| 468 // Updates an optional child View, e.g. Bookmarks Bar, Info Bar, Download | 470 // Updates an optional child View, e.g. Bookmarks Bar, Info Bar, Download |
| 469 // Shelf. If |*old_view| differs from new_view, the old_view is removed and | 471 // Shelf. If |*old_view| differs from new_view, the old_view is removed and |
| 470 // the new_view is added. This is intended to be used when swapping in/out | 472 // the new_view is added. This is intended to be used when swapping in/out |
| 471 // child views that are referenced via a field. | 473 // child views that are referenced via a field. |
| 472 // Returns true if anything was changed, and a re-Layout is now required. | 474 // Returns true if anything was changed, and a re-Layout is now required. |
| 473 bool UpdateChildViewAndLayout(views::View* new_view, views::View** old_view); | 475 bool UpdateChildViewAndLayout(views::View* new_view, views::View** old_view); |
| 474 | 476 |
| 475 // Invoked to update the necessary things when our fullscreen state changes | 477 // Invoked to update the necessary things when our fullscreen state changes |
| 476 // to |fullscreen|. On Windows this is invoked immediately when we toggle the | 478 // to |fullscreen|. On Windows this is invoked immediately when we toggle the |
| (...skipping 18 matching lines...) Expand all Loading... |
| 495 // Callback for the loading animation(s) associated with this view. | 497 // Callback for the loading animation(s) associated with this view. |
| 496 void LoadingAnimationCallback(); | 498 void LoadingAnimationCallback(); |
| 497 | 499 |
| 498 // Initialize the hung plugin detector. | 500 // Initialize the hung plugin detector. |
| 499 void InitHangMonitor(); | 501 void InitHangMonitor(); |
| 500 | 502 |
| 501 // Invoked from TabSelectedAt or when instant is made active. Is | 503 // Invoked from TabSelectedAt or when instant is made active. Is |
| 502 // |change_tab_contents| is true, |new_contents| is added to the view | 504 // |change_tab_contents| is true, |new_contents| is added to the view |
| 503 // hierarchy, if |change_tab_contents| is false, it's assumed |new_contents| | 505 // hierarchy, if |change_tab_contents| is false, it's assumed |new_contents| |
| 504 // has already been added to the view hierarchy. | 506 // has already been added to the view hierarchy. |
| 505 void ProcessTabSelected(TabContents* new_contents, bool change_tab_contents); | 507 void ProcessTabSelected(TabContentsWrapper* new_contents, |
| 508 bool change_tab_contents); |
| 506 | 509 |
| 507 // Last focused view that issued a tab traversal. | 510 // Last focused view that issued a tab traversal. |
| 508 int last_focused_view_storage_id_; | 511 int last_focused_view_storage_id_; |
| 509 | 512 |
| 510 // The BrowserFrame that hosts this view. | 513 // The BrowserFrame that hosts this view. |
| 511 BrowserFrame* frame_; | 514 BrowserFrame* frame_; |
| 512 | 515 |
| 513 // The Browser object we are associated with. | 516 // The Browser object we are associated with. |
| 514 scoped_ptr<Browser> browser_; | 517 scoped_ptr<Browser> browser_; |
| 515 | 518 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 652 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
| 650 | 653 |
| 651 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; | 654 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; |
| 652 | 655 |
| 653 NotificationRegistrar registrar_; | 656 NotificationRegistrar registrar_; |
| 654 | 657 |
| 655 DISALLOW_COPY_AND_ASSIGN(BrowserView); | 658 DISALLOW_COPY_AND_ASSIGN(BrowserView); |
| 656 }; | 659 }; |
| 657 | 660 |
| 658 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 661 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
| OLD | NEW |