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

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

Issue 25373009: Translate: New Bubble UX (for the view toolkit) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sky's review (3) Created 7 years, 2 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/bubble_icon_view.h
diff --git a/chrome/browser/ui/views/location_bar/bubble_icon_view.h b/chrome/browser/ui/views/location_bar/bubble_icon_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..04fa619cebf8ab041a99abdac70b6393d7b85a00
--- /dev/null
+++ b/chrome/browser/ui/views/location_bar/bubble_icon_view.h
@@ -0,0 +1,52 @@
+// Copyright 2013 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_BUBBLE_ICON_VIEW_H_
+#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_
+
+#include "ui/views/controls/image_view.h"
+
+class BubbleIconViewDelegate;
+class CommandUpdater;
+
+// The icon on the Omnibox which can show a bubble when the user click this.
sky 2013/10/23 14:43:29 Represents an icon on the omnibox that shows a bub
hajimehoshi 2013/10/24 11:31:14 Done.
+class BubbleIconView : public views::ImageView {
+ public:
+ explicit BubbleIconView(CommandUpdater* command_updater, int command_id);
+ virtual ~BubbleIconView();
+
+ protected:
+ BubbleIconViewDelegate* delegate() { return delegate_; }
+ void set_delegate(BubbleIconViewDelegate* delegate) { delegate_ = delegate; }
+
+ private:
+ // views::ImageView:
+ virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
+ virtual bool GetTooltipText(const gfx::Point& p, string16* tooltip)
+ const OVERRIDE;
+ virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
+ virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
+ virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
+
+ // ui::EventHandler:
+ virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
+
+ // The CommandUpdater for the Browser object that owns the location bar.
+ CommandUpdater* command_updater_;
+
+ // The command ID executed when the user clicks this icon.
+ const int command_id_;
+
+ // This is used to check if the bookmark bubble was showing during the mouse
+ // pressed event. If this is true then the mouse released event is ignored to
+ // prevent the bubble from reshowing.
+ bool suppress_mouse_released_action_;
+
+ // The delegate of this object.
+ BubbleIconViewDelegate* delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(BubbleIconView);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BUBBLE_ICON_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698