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

Side by Side Diff: chrome/browser/ui/views/location_bar/translate_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: Add the browser test 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_STAR_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_TRANSLATE_ICON_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_STAR_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_TRANSLATE_ICON_VIEW_H_
7 7
8 #include "ui/views/controls/image_view.h" 8 #include "ui/views/controls/image_view.h"
9 9
10 class CommandUpdater; 10 class CommandUpdater;
11 11
12 class StarView : public views::ImageView { 12 // The icon to show the Translate bubble where the user can have the page
13 // tarnslated.
14 class TranslateIconView : public views::ImageView {
13 public: 15 public:
14 explicit StarView(CommandUpdater* command_updater); 16 explicit TranslateIconView(CommandUpdater* command_updater);
15 virtual ~StarView(); 17 virtual ~TranslateIconView();
16
17 // Toggles the star on or off.
18 void SetToggled(bool on);
19 18
20 private: 19 private:
21 // views::ImageView: 20 // views::ImageView:
22 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 21 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
23 virtual bool GetTooltipText(const gfx::Point& p, 22 virtual bool GetTooltipText(const gfx::Point& p,
24 string16* tooltip) const OVERRIDE; 23 string16* tooltip) const OVERRIDE;
25 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; 24 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
26 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; 25 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
27 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; 26 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
28 27
29 // ui::EventHandler: 28 // ui::EventHandler:
30 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; 29 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
31 30
32 // The CommandUpdater for the Browser object that owns the location bar.
33 CommandUpdater* command_updater_; 31 CommandUpdater* command_updater_;
34 32
35 // This is used to check if the bookmark bubble was showing during the mouse 33 // This is used to check if the translate bubble was showing during the mouse
36 // pressed event. If this is true then the mouse released event is ignored to 34 // pressed event. If this is true then the mouse released event is ignored to
37 // prevent the bubble from reshowing. 35 // prevent the bubble from reshowing.
38 bool suppress_mouse_released_action_; 36 bool suppress_mouse_released_action_;
39 37
40 DISALLOW_COPY_AND_ASSIGN(StarView); 38 DISALLOW_COPY_AND_ASSIGN(TranslateIconView);
41 }; 39 };
42 40
43 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_STAR_VIEW_H_ 41 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_TRANSLATE_ICON_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698