OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/bookmark_bar_view.h" | 5 #include "chrome/browser/ui/views/bookmark_bar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 // the context menu. They should not trigger the opening of underlying urls. | 195 // the context menu. They should not trigger the opening of underlying urls. |
196 if (e.flags() == ui::EF_LEFT_BUTTON_DOWN || | 196 if (e.flags() == ui::EF_LEFT_BUTTON_DOWN || |
197 e.flags() == ui::EF_RIGHT_BUTTON_DOWN) | 197 e.flags() == ui::EF_RIGHT_BUTTON_DOWN) |
198 return false; | 198 return false; |
199 | 199 |
200 WindowOpenDisposition disposition( | 200 WindowOpenDisposition disposition( |
201 event_utils::DispositionFromEventFlags(e.flags())); | 201 event_utils::DispositionFromEventFlags(e.flags())); |
202 return disposition != CURRENT_TAB; | 202 return disposition != CURRENT_TAB; |
203 } | 203 } |
204 | 204 |
205 virtual void Paint(gfx::Canvas* canvas) { | 205 virtual void OnPaint(gfx::Canvas* canvas) { |
206 views::MenuButton::Paint(canvas, false); | 206 views::MenuButton::Paint(canvas, false); |
207 } | 207 } |
208 | 208 |
209 private: | 209 private: |
210 scoped_ptr<ui::SlideAnimation> show_animation_; | 210 scoped_ptr<ui::SlideAnimation> show_animation_; |
211 | 211 |
212 DISALLOW_COPY_AND_ASSIGN(BookmarkFolderButton); | 212 DISALLOW_COPY_AND_ASSIGN(BookmarkFolderButton); |
213 }; | 213 }; |
214 | 214 |
215 // OverFlowButton (chevron) -------------------------------------------------- | 215 // OverFlowButton (chevron) -------------------------------------------------- |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 BookmarkNodeData data; | 280 BookmarkNodeData data; |
281 }; | 281 }; |
282 | 282 |
283 // ButtonSeparatorView -------------------------------------------------------- | 283 // ButtonSeparatorView -------------------------------------------------------- |
284 | 284 |
285 class BookmarkBarView::ButtonSeparatorView : public views::View { | 285 class BookmarkBarView::ButtonSeparatorView : public views::View { |
286 public: | 286 public: |
287 ButtonSeparatorView() {} | 287 ButtonSeparatorView() {} |
288 virtual ~ButtonSeparatorView() {} | 288 virtual ~ButtonSeparatorView() {} |
289 | 289 |
290 virtual void Paint(gfx::Canvas* canvas) { | 290 virtual void OnPaint(gfx::Canvas* canvas) { |
291 DetachableToolbarView::PaintVerticalDivider( | 291 DetachableToolbarView::PaintVerticalDivider( |
292 canvas, kSeparatorStartX, height(), 1, | 292 canvas, kSeparatorStartX, height(), 1, |
293 DetachableToolbarView::kEdgeDividerColor, | 293 DetachableToolbarView::kEdgeDividerColor, |
294 DetachableToolbarView::kMiddleDividerColor, | 294 DetachableToolbarView::kMiddleDividerColor, |
295 GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TOOLBAR)); | 295 GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TOOLBAR)); |
296 } | 296 } |
297 | 297 |
298 virtual gfx::Size GetPreferredSize() { | 298 virtual gfx::Size GetPreferredSize() { |
299 // We get the full height of the bookmark bar, so that the height returned | 299 // We get the full height of the bookmark bar, so that the height returned |
300 // here doesn't matter. | 300 // here doesn't matter. |
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 // The tooltip is the only way we have to display text explaining the error | 1747 // The tooltip is the only way we have to display text explaining the error |
1748 // to the user. | 1748 // to the user. |
1749 sync_error_button->SetTooltipText( | 1749 sync_error_button->SetTooltipText( |
1750 UTF16ToWide(l10n_util::GetStringUTF16(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC))); | 1750 UTF16ToWide(l10n_util::GetStringUTF16(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC))); |
1751 sync_error_button->SetAccessibleName( | 1751 sync_error_button->SetAccessibleName( |
1752 l10n_util::GetStringUTF16(IDS_ACCNAME_SYNC_ERROR_BUTTON)); | 1752 l10n_util::GetStringUTF16(IDS_ACCNAME_SYNC_ERROR_BUTTON)); |
1753 sync_error_button->SetIcon( | 1753 sync_error_button->SetIcon( |
1754 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); | 1754 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); |
1755 return sync_error_button; | 1755 return sync_error_button; |
1756 } | 1756 } |
OLD | NEW |