blob: 36b9464fc5163013aca2135e789b4234ec2ffb81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
// 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_BROWSER_TOOLBAR_VIEW_GTK_H_
#define CHROME_BROWSER_BROWSER_TOOLBAR_VIEW_GTK_H_
#include "chrome/browser/command_updater.h"
#include "chrome/common/pref_member.h"
#include <gtk/gtk.h>
class Browser;
class Profile;
class ToolbarModel;
// View class that displays the GTK version of the toolbar and routes gtk
// events back to the Browser.
class BrowserToolbarGtk : public CommandUpdater::CommandObserver {
public:
explicit BrowserToolbarGtk(Browser* browser);
virtual ~BrowserToolbarGtk();
// Create the contents of the toolbar
void Init(Profile* profile);
// Adds this GTK toolbar into a sizing box.
void AddToolbarToBox(GtkWidget* box);
// Overridden from CommandUpdater::CommandObserver:
virtual void EnabledStateChangedForCommand(int id, bool enabled);
void SetProfile(Profile* profile);
private:
class CustomDrawButton; // Defined in the .cc file.
// Builds a toolbar button with all the properties set.
CustomDrawButton* BuildToolbarButton(const std::string& filename,
const std::wstring& localized_tooltip);
// Gtk callback for the "clicked" signal.
static void ButtonClickCallback(GtkWidget* button,
BrowserToolbarGtk* toolbar);
// Gtk widgets. The toolbar is an hbox with each of the other pieces of the
// toolbar placed side by side.
GtkWidget* toolbar_;
// Tooltip container for all GTK widgets in this class.
GtkTooltips* toolbar_tooltips_;
// All the buttons in the toolbar.
scoped_ptr<CustomDrawButton> back_, forward_;
scoped_ptr<CustomDrawButton> reload_, home_;
scoped_ptr<CustomDrawButton> star_, go_;
scoped_ptr<CustomDrawButton> page_menu_, app_menu_;
// The model that contains the security level, text, icon to display...
ToolbarModel* model_;
// TODO(port): Port BackForwardMenuModel
// scoped_ptr<BackForwardMenuModel> back_menu_model_;
// scoped_ptr<BackForwardMenuModel> forward_menu_model_;
Browser* browser_;
Profile* profile_;
// Controls whether or not a home button should be shown on the toolbar.
BooleanPrefMember show_home_button_;
};
#endif
|