summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/compact_navigation_bar.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-26 02:53:02 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-26 02:53:02 +0000
commit67d0d62d638f7b15e031dd2c22756df0109e021d (patch)
tree12fedef3144511b4a9f861fe993d5d39fdc34278 /chrome/browser/chromeos/compact_navigation_bar.h
parente73d4f7b1f150436dae5d589fd73c8d17c2dcb56 (diff)
downloadchromium_src-67d0d62d638f7b15e031dd2c22756df0109e021d.zip
chromium_src-67d0d62d638f7b15e031dd2c22756df0109e021d.tar.gz
chromium_src-67d0d62d638f7b15e031dd2c22756df0109e021d.tar.bz2
Move the compact navigation bar to the chromeos directory.
Generalize the chromeos rules so we don't have to list every file in the exclusions. Review URL: http://codereview.chromium.org/174446 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/compact_navigation_bar.h')
-rw-r--r--chrome/browser/chromeos/compact_navigation_bar.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/compact_navigation_bar.h b/chrome/browser/chromeos/compact_navigation_bar.h
new file mode 100644
index 0000000..f086f34
--- /dev/null
+++ b/chrome/browser/chromeos/compact_navigation_bar.h
@@ -0,0 +1,78 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_COMPACT_NAVIGATION_BAR_H_
+#define CHROME_BROWSER_CHROMEOS_COMPACT_NAVIGATION_BAR_H_
+
+#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
+#include "chrome/browser/autocomplete/autocomplete_edit.h"
+#include "chrome/browser/autocomplete/autocomplete_popup_view.h"
+#include "views/controls/button/button.h"
+#include "views/view.h"
+
+class AutocompleteEditViewGtk;
+class Browser;
+
+namespace views {
+class ImageButton;
+class ImageView;
+class NativeViewHost;
+}
+
+// This class provides a small navigation bar that includes back, forward, and
+// a small text entry box.
+class CompactNavigationBar : public views::View,
+ public views::ButtonListener,
+ public AutocompleteEditController,
+ public AutocompletePopupPositioner {
+ public:
+ explicit CompactNavigationBar(Browser* browser);
+ virtual ~CompactNavigationBar();
+
+ // Must be called before anything else, but after adding this view to the
+ // widget.
+ void Init();
+
+ // views::View overrides.
+ virtual gfx::Size GetPreferredSize();
+ virtual void Layout();
+ virtual void Paint(gfx::Canvas* canvas);
+
+ private:
+ // views::ButtonListener implementation.
+ virtual void ButtonPressed(views::Button* sender);
+
+ // AutocompleteController implementation.
+ virtual void OnAutocompleteAccept(const GURL& url,
+ WindowOpenDisposition disposition,
+ PageTransition::Type transition,
+ const GURL& alternate_nav_url);
+ virtual void OnChanged();
+ virtual void OnInputInProgress(bool in_progress);
+ virtual SkBitmap GetFavIcon() const;
+ virtual std::wstring GetTitle() const;
+
+ // AutocompletePopupPositioner implementation.
+ virtual gfx::Rect GetPopupBounds() const;
+
+ void AddTabWithURL(const GURL& url, PageTransition::Type transition);
+
+ Browser* browser_;
+
+ bool initialized_;
+
+ views::ImageButton* chrome_button_;
+
+ views::ImageButton* back_button_;
+ views::ImageView* bf_separator_;
+ views::ImageButton* forward_button_;
+
+ scoped_ptr<AutocompleteEditViewGtk> location_entry_;
+ views::NativeViewHost* location_entry_view_;
+
+ DISALLOW_COPY_AND_ASSIGN(CompactNavigationBar);
+};
+
+#endif // CHROME_BROWSER_CHROMEOS_COMPACT_NAVIGATION_BAR_H_