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 #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 "base/base_drag_source.h" | 9 #include "base/base_drag_source.h" |
10 #include "base/gfx/skia_utils.h" | 10 #include "base/gfx/skia_utils.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 virtual void AnimationProgressed(const Animation* animation) { | 258 virtual void AnimationProgressed(const Animation* animation) { |
259 ChromeViews::TextButton::AnimationProgressed(animation); | 259 ChromeViews::TextButton::AnimationProgressed(animation); |
260 SchedulePaint(); | 260 SchedulePaint(); |
261 } | 261 } |
262 | 262 |
263 private: | 263 private: |
264 const GURL& url_; | 264 const GURL& url_; |
265 Profile* profile_; | 265 Profile* profile_; |
266 scoped_ptr<SlideAnimation> show_animation_; | 266 scoped_ptr<SlideAnimation> show_animation_; |
267 | 267 |
268 DISALLOW_EVIL_CONSTRUCTORS(BookmarkButton); | 268 DISALLOW_COPY_AND_ASSIGN(BookmarkButton); |
269 }; | 269 }; |
270 | 270 |
271 // DropInfo ------------------------------------------------------------------- | 271 // DropInfo ------------------------------------------------------------------- |
272 | 272 |
273 // Tracks drops on the BookmarkBarView. | 273 // Tracks drops on the BookmarkBarView. |
274 | 274 |
275 struct DropInfo { | 275 struct DropInfo { |
276 DropInfo() : drop_index(-1), is_menu_showing(false), valid(false) {} | 276 DropInfo() : drop_index(-1), is_menu_showing(false), valid(false) {} |
277 | 277 |
278 // Whether the data is valid. | 278 // Whether the data is valid. |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 | 538 |
539 // Mapping from node to menu id. This only contains entries for nodes of type | 539 // Mapping from node to menu id. This only contains entries for nodes of type |
540 // URL. | 540 // URL. |
541 std::map<BookmarkBarNode*, int> node_to_menu_id_map_; | 541 std::map<BookmarkBarNode*, int> node_to_menu_id_map_; |
542 | 542 |
543 // Data for the drop. | 543 // Data for the drop. |
544 BookmarkDragData drop_data_; | 544 BookmarkDragData drop_data_; |
545 | 545 |
546 scoped_ptr<BookmarkBarContextMenuController> context_menu_; | 546 scoped_ptr<BookmarkBarContextMenuController> context_menu_; |
547 | 547 |
548 DISALLOW_EVIL_CONSTRUCTORS(MenuRunner); | 548 DISALLOW_COPY_AND_ASSIGN(MenuRunner); |
549 }; | 549 }; |
550 | 550 |
551 // ButtonSeparatorView -------------------------------------------------------- | 551 // ButtonSeparatorView -------------------------------------------------------- |
552 | 552 |
553 // TODO(sky/glen): this is temporary, need to decide on what this should | 553 // TODO(sky/glen): this is temporary, need to decide on what this should |
554 // look like. | 554 // look like. |
555 class ButtonSeparatorView : public ChromeViews::View { | 555 class ButtonSeparatorView : public ChromeViews::View { |
556 public: | 556 public: |
557 ButtonSeparatorView() {} | 557 ButtonSeparatorView() {} |
558 virtual ~ButtonSeparatorView() {} | 558 virtual ~ButtonSeparatorView() {} |
(...skipping 19 matching lines...) Expand all Loading... |
578 canvas->drawRect(rc_down, paint_down); | 578 canvas->drawRect(rc_down, paint_down); |
579 } | 579 } |
580 | 580 |
581 virtual void GetPreferredSize(CSize* out) { | 581 virtual void GetPreferredSize(CSize* out) { |
582 // We get the full height of the bookmark bar, so that the height returned | 582 // We get the full height of the bookmark bar, so that the height returned |
583 // here doesn't matter. | 583 // here doesn't matter. |
584 out->SetSize(kSeparatorWidth, 1); | 584 out->SetSize(kSeparatorWidth, 1); |
585 } | 585 } |
586 | 586 |
587 private: | 587 private: |
588 DISALLOW_EVIL_CONSTRUCTORS(ButtonSeparatorView); | 588 DISALLOW_COPY_AND_ASSIGN(ButtonSeparatorView); |
589 }; | 589 }; |
590 | 590 |
591 } // namespace | 591 } // namespace |
592 | 592 |
593 // BookmarkBarView ------------------------------------------------------------ | 593 // BookmarkBarView ------------------------------------------------------------ |
594 | 594 |
595 // static | 595 // static |
596 const int BookmarkBarView::kMaxButtonWidth = 150; | 596 const int BookmarkBarView::kMaxButtonWidth = 150; |
597 | 597 |
598 // static | 598 // static |
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1832 | 1832 |
1833 void BookmarkBarView::StopThrobbing(bool immediate) { | 1833 void BookmarkBarView::StopThrobbing(bool immediate) { |
1834 if (!throbbing_view_) | 1834 if (!throbbing_view_) |
1835 return; | 1835 return; |
1836 | 1836 |
1837 // If not immediate, cycle through 2 more complete cycles. | 1837 // If not immediate, cycle through 2 more complete cycles. |
1838 throbbing_view_->StartThrobbing(immediate ? 0 : 4); | 1838 throbbing_view_->StartThrobbing(immediate ? 0 : 4); |
1839 throbbing_view_ = NULL; | 1839 throbbing_view_ = NULL; |
1840 } | 1840 } |
1841 | 1841 |
OLD | NEW |