Chromium Code Reviews
|
| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_COMPACT_NAV_COMPACT_NAVIGATION_BAR_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_COMPACT_NAV_COMPACT_NAVIGATION_BAR_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/scoped_ptr.h" | |
| 10 #include "chrome/browser/command_updater.h" | |
| 11 #include "views/controls/button/button.h" | |
| 12 #include "views/view.h" | |
| 13 | |
| 14 class BackForwardMenuModel; | |
| 15 class BrowserView; | |
| 16 | |
| 17 namespace views { | |
| 18 class ImageButton; | |
| 19 class ImageView; | |
| 20 } | |
| 21 | |
| 22 // This class provides a small navigation bar that includes back, forward, and | |
| 23 // a small text entry box. | |
| 24 class CompactNavigationBar : public views::View, | |
| 25 public views::ButtonListener, | |
| 26 public CommandUpdater::CommandObserver { | |
| 27 public: | |
| 28 explicit CompactNavigationBar(BrowserView* browser_view); | |
| 29 virtual ~CompactNavigationBar(); | |
| 30 | |
| 31 // Must be called before anything else, but after adding this view to the | |
| 32 // widget. | |
| 33 void Init(); | |
| 34 | |
| 35 // views::View overrides. | |
| 36 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
| 37 virtual void Layout() OVERRIDE; | |
| 38 // virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | |
|
sky
2011/05/09 14:27:22
remove this
SteveT
2011/05/09 19:40:04
Done.
| |
| 39 | |
| 40 private: | |
| 41 // views::ButtonListener implementation. | |
| 42 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | |
| 43 | |
| 44 // CommandUpdater::CommandObserver implementation. | |
| 45 virtual void EnabledStateChangedForCommand(int id, bool enabled); | |
| 46 | |
| 47 // Load the images for the back and forward buttons. | |
| 48 void LoadImages(); | |
| 49 | |
| 50 ::BrowserView* browser_view_; | |
|
sky
2011/05/09 14:27:22
no ::
SteveT
2011/05/09 19:40:04
Done.
| |
| 51 | |
| 52 bool initialized_; | |
| 53 | |
| 54 views::ImageButton* back_; | |
| 55 views::ImageView* bf_separator_; | |
| 56 views::ImageButton* forward_; | |
| 57 | |
| 58 // History menu for back and forward buttons. | |
| 59 scoped_ptr<BackForwardMenuModel> back_menu_model_; | |
| 60 scoped_ptr<BackForwardMenuModel> forward_menu_model_; | |
| 61 | |
| 62 DISALLOW_COPY_AND_ASSIGN(CompactNavigationBar); | |
| 63 }; | |
| 64 | |
| 65 #endif // CHROME_BROWSER_UI_VIEWS_COMPACT_NAV_COMPACT_NAVIGATION_BAR_H_ | |
| OLD | NEW |