| 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 #include "chrome/browser/views/bookmark_bar_view.h" | 5 #include "chrome/browser/views/bookmark_bar_view.h" | 
| 6 | 6 | 
| 7 #include <limits> | 7 #include <limits> | 
| 8 | 8 | 
| 9 #include "app/gfx/canvas.h" | 9 #include "app/gfx/canvas.h" | 
| 10 #include "app/gfx/text_elider.h" | 10 #include "app/gfx/text_elider.h" | 
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 70 | 70 | 
| 71 // Command ids used in the menu allowing the user to choose when we're visible. | 71 // Command ids used in the menu allowing the user to choose when we're visible. | 
| 72 static const int kAlwaysShowCommandID = 1; | 72 static const int kAlwaysShowCommandID = 1; | 
| 73 | 73 | 
| 74 // Icon to display when one isn't found for the page. | 74 // Icon to display when one isn't found for the page. | 
| 75 static SkBitmap* kDefaultFavIcon = NULL; | 75 static SkBitmap* kDefaultFavIcon = NULL; | 
| 76 | 76 | 
| 77 // Icon used for folders. | 77 // Icon used for folders. | 
| 78 static SkBitmap* kFolderIcon = NULL; | 78 static SkBitmap* kFolderIcon = NULL; | 
| 79 | 79 | 
| 80 // Border colors for the BookmarBarView. |  | 
| 81 static const SkColor kTopBorderColor = SkColorSetRGB(222, 234, 248); |  | 
| 82 |  | 
| 83 // Offset for where the menu is shown relative to the bottom of the | 80 // Offset for where the menu is shown relative to the bottom of the | 
| 84 // BookmarkBarView. | 81 // BookmarkBarView. | 
| 85 static const int kMenuOffset = 3; | 82 static const int kMenuOffset = 3; | 
| 86 | 83 | 
| 87 // Delay during drag and drop before the menu pops up. This is only used if | 84 // Delay during drag and drop before the menu pops up. This is only used if | 
| 88 // we can't get the value from the OS. | 85 // we can't get the value from the OS. | 
| 89 static const int kShowFolderDropMenuDelay = 400; | 86 static const int kShowFolderDropMenuDelay = 400; | 
| 90 | 87 | 
| 91 // Color of the drop indicator. | 88 // Color of the drop indicator. | 
| 92 static const SkColor kDropIndicatorColor = SK_ColorBLACK; | 89 static const SkColor kDropIndicatorColor = SK_ColorBLACK; | 
| 93 | 90 | 
| 94 // Width of the drop indicator. | 91 // Width of the drop indicator. | 
| 95 static const int kDropIndicatorWidth = 2; | 92 static const int kDropIndicatorWidth = 2; | 
| 96 | 93 | 
| 97 // Distance between the bottom of the bar and the separator. | 94 // Distance between the bottom of the bar and the separator. | 
| 98 static const int kSeparatorMargin = 1; | 95 static const int kSeparatorMargin = 1; | 
| 99 | 96 | 
| 100 // Width of the separator between the recently bookmarked button and the | 97 // Width of the separator between the recently bookmarked button and the | 
| 101 // overflow indicator. | 98 // overflow indicator. | 
| 102 static const int kSeparatorWidth = 4; | 99 static const int kSeparatorWidth = 4; | 
| 103 | 100 | 
| 104 // Starting x-coordinate of the separator line within a separator. | 101 // Starting x-coordinate of the separator line within a separator. | 
| 105 static const int kSeparatorStartX = 2; | 102 static const int kSeparatorStartX = 2; | 
| 106 | 103 | 
| 107 // Border color along the left edge of the view representing the most recently |  | 
| 108 // view pages. |  | 
| 109 static const SkColor kSeparatorColor = SkColorSetRGB(194, 205, 212); |  | 
| 110 |  | 
| 111 // Left-padding for the instructional text. | 104 // Left-padding for the instructional text. | 
| 112 static const int kInstructionsPadding = 6; | 105 static const int kInstructionsPadding = 6; | 
| 113 | 106 | 
| 114 // Color of the instructional text. | 107 // Color of the instructional text. | 
| 115 static const SkColor kInstructionsColor = SkColorSetRGB(128, 128, 142); | 108 static const SkColor kInstructionsColor = SkColorSetRGB(128, 128, 142); | 
| 116 | 109 | 
| 117 // Tag for the 'Other bookmarks' button. | 110 // Tag for the 'Other bookmarks' button. | 
| 118 static const int kOtherFolderButtonTag = 1; | 111 static const int kOtherFolderButtonTag = 1; | 
| 119 | 112 | 
| 120 #ifdef CHROME_PERSONALIZATION | 113 #ifdef CHROME_PERSONALIZATION | 
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 288 | 281 | 
| 289 // ButtonSeparatorView  -------------------------------------------------------- | 282 // ButtonSeparatorView  -------------------------------------------------------- | 
| 290 | 283 | 
| 291 class BookmarkBarView::ButtonSeparatorView : public views::View { | 284 class BookmarkBarView::ButtonSeparatorView : public views::View { | 
| 292  public: | 285  public: | 
| 293   ButtonSeparatorView() {} | 286   ButtonSeparatorView() {} | 
| 294   virtual ~ButtonSeparatorView() {} | 287   virtual ~ButtonSeparatorView() {} | 
| 295 | 288 | 
| 296   virtual void Paint(gfx::Canvas* canvas) { | 289   virtual void Paint(gfx::Canvas* canvas) { | 
| 297     DetachableToolbarView::PaintVerticalDivider( | 290     DetachableToolbarView::PaintVerticalDivider( | 
| 298         canvas, kSeparatorStartX, height(), 1, kTopBorderColor, | 291         canvas, kSeparatorStartX, height(), 1, | 
| 299         kSeparatorColor, | 292         DetachableToolbarView::kEdgeDividerColor, | 
|  | 293         DetachableToolbarView::kMiddleDividerColor, | 
| 300         GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TOOLBAR)); | 294         GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TOOLBAR)); | 
| 301   } | 295   } | 
| 302 | 296 | 
| 303   virtual gfx::Size GetPreferredSize() { | 297   virtual gfx::Size GetPreferredSize() { | 
| 304     // We get the full height of the bookmark bar, so that the height returned | 298     // We get the full height of the bookmark bar, so that the height returned | 
| 305     // here doesn't matter. | 299     // here doesn't matter. | 
| 306     return gfx::Size(kSeparatorWidth, 1); | 300     return gfx::Size(kSeparatorWidth, 1); | 
| 307   } | 301   } | 
| 308 | 302 | 
| 309   virtual bool GetAccessibleName(std::wstring* name) { | 303   virtual bool GetAccessibleName(std::wstring* name) { | 
| (...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1729   sync_error_button->SetTooltipText( | 1723   sync_error_button->SetTooltipText( | 
| 1730       l10n_util::GetString(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)); | 1724       l10n_util::GetString(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)); | 
| 1731   sync_error_button->SetAccessibleName( | 1725   sync_error_button->SetAccessibleName( | 
| 1732       l10n_util::GetString(IDS_ACCNAME_SYNC_ERROR_BUTTON)); | 1726       l10n_util::GetString(IDS_ACCNAME_SYNC_ERROR_BUTTON)); | 
| 1733   sync_error_button->SetIcon( | 1727   sync_error_button->SetIcon( | 
| 1734       *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); | 1728       *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); | 
| 1735   return sync_error_button; | 1729   return sync_error_button; | 
| 1736 } | 1730 } | 
| 1737 #endif | 1731 #endif | 
| 1738 | 1732 | 
| OLD | NEW | 
|---|