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

Side by Side Diff: chrome/browser/ui/views/location_bar/action_box_button_view.h

Issue 10533086: Action box menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Action box menu 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_ACTION_BOX_BUTTON_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
9 #include "ui/views/controls/button/menu_button.h" 10 #include "ui/views/controls/button/menu_button.h"
10 #include "ui/views/controls/button/menu_button_listener.h" 11 #include "ui/views/controls/button/menu_button_listener.h"
11 12
12 class ExtensionService; 13 class ActionBoxMenu;
14 class Profile;
13 15
14 // ActionBoxButtonView displays a plus button with associated menu. 16 // ActionBoxButtonView displays a plus button with associated menu.
15 class ActionBoxButtonView : public views::MenuButton, 17 class ActionBoxButtonView : public views::MenuButton,
16 public views::MenuButtonListener { 18 public views::MenuButtonListener {
17 public: 19 public:
18 explicit ActionBoxButtonView(ExtensionService* extension_service); 20 explicit ActionBoxButtonView(Profile* profile,
21 LocationBarView::Delegate* delegate);
19 virtual ~ActionBoxButtonView(); 22 virtual ~ActionBoxButtonView();
20 23
21 SkColor GetBackgroundColor(); 24 SkColor GetBackgroundColor();
22 SkColor GetBorderColor(); 25 SkColor GetBorderColor();
23 26
27 void SetBookmarkState(bool on);
28
24 private: 29 private:
25 // CustomButton 30 // CustomButton
26 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 31 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
27 32
28 // MenuButtonListener 33 // MenuButtonListener
29 virtual void OnMenuButtonClicked(View* source, 34 virtual void OnMenuButtonClicked(View* source,
30 const gfx::Point& point) OVERRIDE; 35 const gfx::Point& point) OVERRIDE;
31 36
32 ExtensionService* extension_service_; 37 Profile* profile_;
38
39 LocationBarView::Delegate* delegate_;
Aaron Boodman 2012/07/02 22:41:34 Weird to store another class' delegate. Seems like
yefimt 2012/07/11 22:34:34 The problem is at the time of button creation GetB
Aaron Boodman 2012/07/13 01:53:07 In that case, define a delegate for ActionBoxButto
yefimt 2012/07/13 19:59:20 Done.
40
41 scoped_ptr<ActionBoxMenu> action_box_menu_;
42
43 bool bookmark_state_;
33 44
34 DISALLOW_COPY_AND_ASSIGN(ActionBoxButtonView); 45 DISALLOW_COPY_AND_ASSIGN(ActionBoxButtonView);
35 }; 46 };
36 47
37 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_ 48 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ACTION_BOX_BUTTON_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698