Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7643)

Unified Diff: chrome/browser/ui/views/location_bar/metro_pin_view.h

Issue 10800054: Add pin icon to the omnibar in windows 8 metro mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/location_bar/metro_pin_view.h
diff --git a/chrome/browser/ui/views/location_bar/metro_pin_view.h b/chrome/browser/ui/views/location_bar/metro_pin_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..a561b24cbbfcb85fff24b232cae32163680cec5b
--- /dev/null
+++ b/chrome/browser/ui/views/location_bar/metro_pin_view.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 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_UI_VIEWS_LOCATION_BAR_METRO_PIN_VIEW_H_
+#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_METRO_PIN_VIEW_H_
+
+#include "chrome/browser/ui/views/location_bar/touchable_location_bar_view.h"
+#include "ui/views/controls/image_view.h"
+
+class CommandUpdater;
+
+namespace views {
+class KeyEvent;
+class MouseEvent;
+}
+
+class MetroPinView
+ : public views::ImageView,
+ public TouchableLocationBarView {
+ public:
+ explicit MetroPinView(CommandUpdater* command_updater);
+ virtual ~MetroPinView();
+
+ // When the page is already pinned, clicking the pin view will cause the page
+ // to become unpinned.
+ void SetIsPinned(bool is_pinned);
+
+ // TouchableLocationBarView.
+ virtual int GetBuiltInHorizontalPadding() const OVERRIDE;
+
+ private:
+ // views::ImageView overrides:
+ virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
+ virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE;
+ virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;
+ virtual ui::GestureStatus OnGestureEvent(
+ const views::GestureEvent& event) OVERRIDE;
+ virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE;
+
+ // The CommandUpdater for the Browser object that owns the location bar.
+ CommandUpdater* command_updater_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(MetroPinView);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_METRO_PIN_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698