| 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_VIEWS_FRAME_BROWSER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/browser_window.h" | 9 #include "chrome/browser/browser_window.h" |
| 10 #include "chrome/browser/hang_monitor/hung_plugin_action.h" | 10 #include "chrome/browser/hang_monitor/hung_plugin_action.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // Provides the containing frame with the accelerator for the specified | 122 // Provides the containing frame with the accelerator for the specified |
| 123 // command id. This can be used to provide menu item shortcut hints etc. | 123 // command id. This can be used to provide menu item shortcut hints etc. |
| 124 // Returns true if an accelerator was found for the specified |cmd_id|, false | 124 // Returns true if an accelerator was found for the specified |cmd_id|, false |
| 125 // otherwise. | 125 // otherwise. |
| 126 bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); | 126 bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); |
| 127 | 127 |
| 128 // Handles incoming system messages. Returns true if the message was | 128 // Handles incoming system messages. Returns true if the message was |
| 129 // handled. | 129 // handled. |
| 130 bool SystemCommandReceived(UINT notification_code, const gfx::Point& point); | 130 bool SystemCommandReceived(UINT notification_code, const gfx::Point& point); |
| 131 | 131 |
| 132 // Adds view to the set of views that drops are allowed to occur on. You only | |
| 133 // need invoke this for views whose y-coordinate extends above the tab strip | |
| 134 // and you want to allow drops on. | |
| 135 void AddViewToDropList(views::View* view); | |
| 136 | |
| 137 // Shows the next app-modal dialog box, if there is one to be shown, or moves | 132 // Shows the next app-modal dialog box, if there is one to be shown, or moves |
| 138 // an existing showing one to the front. Returns true if one was shown or | 133 // an existing showing one to the front. Returns true if one was shown or |
| 139 // activated, false if none was shown. | 134 // activated, false if none was shown. |
| 140 bool ActivateAppModalDialog() const; | 135 bool ActivateAppModalDialog() const; |
| 141 | 136 |
| 142 // Called when the activation of the frame changes. | 137 // Called when the activation of the frame changes. |
| 143 void ActivationChanged(bool activated); | 138 void ActivationChanged(bool activated); |
| 144 | 139 |
| 145 // Returns the selected TabContents. Used by our NonClientView's | 140 // Returns the selected TabContents. Used by our NonClientView's |
| 146 // TabIconView::TabContentsProvider implementations. | 141 // TabIconView::TabContentsProvider implementations. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 #endif | 258 #endif |
| 264 | 259 |
| 265 virtual std::string GetClassName() const; | 260 virtual std::string GetClassName() const; |
| 266 | 261 |
| 267 protected: | 262 protected: |
| 268 // Overridden from views::View: | 263 // Overridden from views::View: |
| 269 virtual void Layout(); | 264 virtual void Layout(); |
| 270 virtual void ViewHierarchyChanged(bool is_add, | 265 virtual void ViewHierarchyChanged(bool is_add, |
| 271 views::View* parent, | 266 views::View* parent, |
| 272 views::View* child); | 267 views::View* child); |
| 273 // As long as ShouldForwardToTabStrip returns true, drag and drop methods | |
| 274 // are forwarded to the tab strip. | |
| 275 virtual bool CanDrop(const OSExchangeData& data); | |
| 276 virtual void OnDragEntered(const views::DropTargetEvent& event); | |
| 277 virtual int OnDragUpdated(const views::DropTargetEvent& event); | |
| 278 virtual void OnDragExited(); | |
| 279 virtual int OnPerformDrop(const views::DropTargetEvent& event); | |
| 280 | |
| 281 private: | 268 private: |
| 282 // Information saved before going into fullscreen mode, used to restore the | 269 // Information saved before going into fullscreen mode, used to restore the |
| 283 // window afterwards. | 270 // window afterwards. |
| 284 struct SavedWindowInfo { | 271 struct SavedWindowInfo { |
| 285 bool maximized; | 272 bool maximized; |
| 286 LONG style; | 273 LONG style; |
| 287 LONG ex_style; | 274 LONG ex_style; |
| 288 RECT window_rect; | 275 RECT window_rect; |
| 289 }; | 276 }; |
| 290 | 277 |
| 291 // Creates the system menu. | 278 // Creates the system menu. |
| 292 void InitSystemMenu(); | 279 void InitSystemMenu(); |
| 293 | 280 |
| 294 // Returns true if the event should be forwarded to the TabStrip. This | |
| 295 // returns true if y coordinate is less than the bottom of the tab strip, and | |
| 296 // is not over another child view. | |
| 297 virtual bool ShouldForwardToTabStrip(const views::DropTargetEvent& event); | |
| 298 | |
| 299 // Creates and returns a new DropTargetEvent in the coordinates of the | |
| 300 // TabStrip. | |
| 301 views::DropTargetEvent* MapEventToTabStrip( | |
| 302 const views::DropTargetEvent& event); | |
| 303 | |
| 304 // Layout the TabStrip, returns the coordinate of the bottom of the TabStrip, | 281 // Layout the TabStrip, returns the coordinate of the bottom of the TabStrip, |
| 305 // for laying out subsequent controls. | 282 // for laying out subsequent controls. |
| 306 int LayoutTabStrip(); | 283 int LayoutTabStrip(); |
| 307 // Layout the following controls, starting at |top|, returns the coordinate | 284 // Layout the following controls, starting at |top|, returns the coordinate |
| 308 // of the bottom of the control, for laying out the next control. | 285 // of the bottom of the control, for laying out the next control. |
| 309 int LayoutToolbar(int top); | 286 int LayoutToolbar(int top); |
| 310 int LayoutBookmarkAndInfoBars(int top); | 287 int LayoutBookmarkAndInfoBars(int top); |
| 311 int LayoutBookmarkBar(int top); | 288 int LayoutBookmarkBar(int top); |
| 312 int LayoutInfoBar(int top); | 289 int LayoutInfoBar(int top); |
| 313 // Layout the TabContents container, between the coordinates |top| and | 290 // Layout the TabContents container, between the coordinates |top| and |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 SavedWindowInfo saved_window_info_; | 396 SavedWindowInfo saved_window_info_; |
| 420 | 397 |
| 421 scoped_ptr<FullscreenExitBubble> fullscreen_bubble_; | 398 scoped_ptr<FullscreenExitBubble> fullscreen_bubble_; |
| 422 | 399 |
| 423 // Lazily created representation of the system menu. | 400 // Lazily created representation of the system menu. |
| 424 scoped_ptr<Menu> system_menu_; | 401 scoped_ptr<Menu> system_menu_; |
| 425 | 402 |
| 426 // The default favicon image. | 403 // The default favicon image. |
| 427 static SkBitmap default_favicon_; | 404 static SkBitmap default_favicon_; |
| 428 | 405 |
| 429 // Initially set in CanDrop by invoking the same method on the TabStrip. | |
| 430 bool can_drop_; | |
| 431 | |
| 432 // If true, drag and drop events are being forwarded to the tab strip. | |
| 433 // This is used to determine when to send OnDragExited and OnDragExited | |
| 434 // to the tab strip. | |
| 435 bool forwarding_to_tab_strip_; | |
| 436 | |
| 437 // Set of additional views drops are allowed on. We do NOT own these. | |
| 438 std::set<views::View*> dropable_views_; | |
| 439 | |
| 440 // The OTR avatar image. | 406 // The OTR avatar image. |
| 441 static SkBitmap otr_avatar_; | 407 static SkBitmap otr_avatar_; |
| 442 | 408 |
| 443 // The delegate for the encoding menu. | 409 // The delegate for the encoding menu. |
| 444 scoped_ptr<EncodingMenuControllerDelegate> encoding_menu_delegate_; | 410 scoped_ptr<EncodingMenuControllerDelegate> encoding_menu_delegate_; |
| 445 | 411 |
| 446 // This object is used to perform periodic actions in a worker | 412 // This object is used to perform periodic actions in a worker |
| 447 // thread. It is currently used to monitor hung plugin windows. | 413 // thread. It is currently used to monitor hung plugin windows. |
| 448 WorkerThreadTicker ticker_; | 414 WorkerThreadTicker ticker_; |
| 449 | 415 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 462 // P13N stuff | 428 // P13N stuff |
| 463 #ifdef CHROME_PERSONALIZATION | 429 #ifdef CHROME_PERSONALIZATION |
| 464 FramePersonalization personalization_; | 430 FramePersonalization personalization_; |
| 465 bool personalization_enabled_; | 431 bool personalization_enabled_; |
| 466 #endif | 432 #endif |
| 467 | 433 |
| 468 DISALLOW_COPY_AND_ASSIGN(BrowserView); | 434 DISALLOW_COPY_AND_ASSIGN(BrowserView); |
| 469 }; | 435 }; |
| 470 | 436 |
| 471 #endif // CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ | 437 #endif // CHROME_BROWSER_VIEWS_FRAME_BROWSER_VIEW_H_ |
| OLD | NEW |