| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_BOOKMARK_BAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_BOOKMARK_BAR_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_BOOKMARK_BAR_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_BOOKMARK_BAR_VIEW_H_ |
| 7 | 7 |
| 8 #include "app/slide_animation.h" | 8 #include "app/slide_animation.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_drag_data.h" | 9 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_observer.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_observer.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // Returns the position to anchor the menu for |button| at, the index of the | 200 // Returns the position to anchor the menu for |button| at, the index of the |
| 201 // first child of the node to build the menu from. | 201 // first child of the node to build the menu from. |
| 202 void GetAnchorPositionAndStartIndexForButton( | 202 void GetAnchorPositionAndStartIndexForButton( |
| 203 views::MenuButton* button, | 203 views::MenuButton* button, |
| 204 views::MenuItemView::AnchorPosition* anchor, | 204 views::MenuItemView::AnchorPosition* anchor, |
| 205 int* start_index); | 205 int* start_index); |
| 206 | 206 |
| 207 // Maximum size of buttons on the bookmark bar. | 207 // Maximum size of buttons on the bookmark bar. |
| 208 static const int kMaxButtonWidth; | 208 static const int kMaxButtonWidth; |
| 209 | 209 |
| 210 // If a button is currently throbbing, it is stopped. If immediate is true |
| 211 // the throb stops immediately, otherwise it stops after a couple more |
| 212 // throbs. |
| 213 void StopThrobbing(bool immediate); |
| 214 |
| 210 // If true we're running tests. This short circuits a couple of animations. | 215 // If true we're running tests. This short circuits a couple of animations. |
| 211 static bool testing_; | 216 static bool testing_; |
| 212 | 217 |
| 213 // Constants used in Browser View, as well as here. | 218 // Constants used in Browser View, as well as here. |
| 214 // How inset the bookmarks bar is when displayed on the new tab page. | 219 // How inset the bookmarks bar is when displayed on the new tab page. |
| 215 static const int kNewtabHorizontalPadding; | 220 static const int kNewtabHorizontalPadding; |
| 216 static const int kNewtabVerticalPadding; | 221 static const int kNewtabVerticalPadding; |
| 217 | 222 |
| 218 private: | 223 private: |
| 219 class ButtonSeparatorView; | 224 class ButtonSeparatorView; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 const BookmarkDragData& data, | 394 const BookmarkDragData& data, |
| 390 int* index, | 395 int* index, |
| 391 bool* drop_on, | 396 bool* drop_on, |
| 392 bool* is_over_overflow, | 397 bool* is_over_overflow, |
| 393 bool* is_over_other); | 398 bool* is_over_other); |
| 394 | 399 |
| 395 // Returns the index of the first hidden bookmark button. If all buttons are | 400 // Returns the index of the first hidden bookmark button. If all buttons are |
| 396 // visible, this returns GetBookmarkButtonCount(). | 401 // visible, this returns GetBookmarkButtonCount(). |
| 397 int GetFirstHiddenNodeIndex(); | 402 int GetFirstHiddenNodeIndex(); |
| 398 | 403 |
| 399 // If the bookmark bubble is showing this determines which view should throb | 404 // This determines which view should throb and starts it |
| 400 // and starts it throbbing. Does nothing if bookmark bubble isn't showing. | 405 // throbbing (e.g when the bookmark bubble is showing). |
| 401 void StartThrobbing(); | 406 // If |overflow_only| is true, start throbbing only if |node| is hidden in |
| 402 | 407 // the overflow menu. |
| 403 // If a button is currently throbbing, it is stopped. If immediate is true | 408 void StartThrobbing(const BookmarkNode* node, bool overflow_only); |
| 404 // the throb stops immediately, otherwise it stops after a couple more | |
| 405 // throbs. | |
| 406 void StopThrobbing(bool immediate); | |
| 407 | 409 |
| 408 // Updates the colors for all the child objects in the bookmarks bar. | 410 // Updates the colors for all the child objects in the bookmarks bar. |
| 409 void UpdateColors(); | 411 void UpdateColors(); |
| 410 | 412 |
| 411 // This method computes the bounds for the bookmark bar items. If | 413 // This method computes the bounds for the bookmark bar items. If |
| 412 // |compute_bounds_only| = TRUE, the bounds for the items are just computed, | 414 // |compute_bounds_only| = TRUE, the bounds for the items are just computed, |
| 413 // but are not set. This mode is used by GetPreferredSize() to obtain the | 415 // but are not set. This mode is used by GetPreferredSize() to obtain the |
| 414 // desired bounds. If |compute_bounds_only| = FALSE, the bounds are set. | 416 // desired bounds. If |compute_bounds_only| = FALSE, the bounds are set. |
| 415 gfx::Size LayoutItems(bool compute_bounds_only); | 417 gfx::Size LayoutItems(bool compute_bounds_only); |
| 416 | 418 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 views::Label* instructions_; | 469 views::Label* instructions_; |
| 468 | 470 |
| 469 ButtonSeparatorView* bookmarks_separator_view_; | 471 ButtonSeparatorView* bookmarks_separator_view_; |
| 470 | 472 |
| 471 // Owning browser. This is NULL during testing. | 473 // Owning browser. This is NULL during testing. |
| 472 Browser* browser_; | 474 Browser* browser_; |
| 473 | 475 |
| 474 // Animation controlling showing and hiding of the bar. | 476 // Animation controlling showing and hiding of the bar. |
| 475 scoped_ptr<SlideAnimation> size_animation_; | 477 scoped_ptr<SlideAnimation> size_animation_; |
| 476 | 478 |
| 477 // If the bookmark bubble is showing, this is the URL. | |
| 478 GURL bubble_url_; | |
| 479 | |
| 480 // If the bookmark bubble is showing, this is the visible ancestor of the URL. | 479 // If the bookmark bubble is showing, this is the visible ancestor of the URL. |
| 481 // The visible ancestor is either the other_bookmarked_button_, | 480 // The visible ancestor is either the other_bookmarked_button_, |
| 482 // overflow_button_ or a button on the bar. | 481 // overflow_button_ or a button on the bar. |
| 483 views::CustomButton* throbbing_view_; | 482 views::CustomButton* throbbing_view_; |
| 484 | 483 |
| 485 // Background for extension toolstrips. | 484 // Background for extension toolstrips. |
| 486 SkBitmap toolstrip_background_; | 485 SkBitmap toolstrip_background_; |
| 487 | 486 |
| 488 // Storage of strings needed for accessibility. | 487 // Storage of strings needed for accessibility. |
| 489 std::wstring accessible_name_; | 488 std::wstring accessible_name_; |
| 490 | 489 |
| 491 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); | 490 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); |
| 492 }; | 491 }; |
| 493 | 492 |
| 494 #endif // CHROME_BROWSER_VIEWS_BOOKMARK_BAR_VIEW_H_ | 493 #endif // CHROME_BROWSER_VIEWS_BOOKMARK_BAR_VIEW_H_ |
| OLD | NEW |