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

Side by Side Diff: chrome/browser/gtk/keyword_editor_view.h

Issue 141026: Add a (non functional) gtk KeywordEditorWindow and hook it up in the relevant places. (Closed)
Patch Set: comment typo Created 11 years, 6 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
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | chrome/browser/gtk/keyword_editor_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_GTK_KEYWORD_EDITOR_VIEW_H_
6 #define CHROME_BROWSER_GTK_KEYWORD_EDITOR_VIEW_H_
7
8 #include <gtk/gtk.h>
9
10 #include "base/basictypes.h"
11 #include "chrome/browser/search_engines/edit_keyword_controller_base.h"
12 #include "chrome/browser/search_engines/template_url_model.h"
13
14 class Profile;
15
16 class KeywordEditorView : public TemplateURLModelObserver,
17 public EditKeywordControllerBase::Delegate {
18 public:
19 virtual ~KeywordEditorView();
20
21 // Create (if necessary) and show the keyword editor window.
22 static void Show(Profile* profile);
23
24 // Overriden from EditKeywordControllerBase::Delegate.
25 virtual void OnEditedKeyword(const TemplateURL* template_url,
26 const std::wstring& title,
27 const std::wstring& keyword,
28 const std::wstring& url);
29 private:
30 explicit KeywordEditorView(Profile* profile);
31 void Init();
32
33 // Enable buttons based on selection state.
34 void EnableControls();
35
36 // TemplateURLModelObserver notification.
37 virtual void OnTemplateURLModelChanged();
38
39 // Callback for window destruction.
40 static void OnWindowDestroy(GtkWidget* widget, KeywordEditorView* window);
41
42 // Callback for dialog buttons.
43 static void OnResponse(GtkDialog* dialog, int response_id,
44 KeywordEditorView* window);
45
46 // Callback for when user selects something.
47 static void OnSelectionChanged(GtkTreeSelection *selection,
48 KeywordEditorView* editor);
49
50 // Callbacks for buttons modifying the table.
51 static void OnAddButtonClicked(GtkButton* button,
52 KeywordEditorView* editor);
53 static void OnEditButtonClicked(GtkButton* button,
54 KeywordEditorView* editor);
55 static void OnRemoveButtonClicked(GtkButton* button,
56 KeywordEditorView* editor);
57 static void OnMakeDefaultButtonClicked(GtkButton* button,
58 KeywordEditorView* editor);
59
60 // The table listing the search engines.
61 GtkWidget* tree_;
62 GtkListStore* list_store_;
63 GtkTreeSelection* selection_;
64
65 // Buttons for acting on the table.
66 GtkWidget* add_button_;
67 GtkWidget* edit_button_;
68 GtkWidget* remove_button_;
69 GtkWidget* make_default_button_;
70
71 // The containing dialog.
72 GtkWidget* dialog_;
73
74 // The profile.
75 Profile* profile_;
76
77 // Model containing TemplateURLs. We listen for changes on this and propagate
78 // them to the table model.
79 TemplateURLModel* url_model_;
80
81 DISALLOW_COPY_AND_ASSIGN(KeywordEditorView);
82 };
83
84 #endif // CHROME_BROWSER_GTK_KEYWORD_EDITOR_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/gtk/browser_window_gtk.cc ('k') | chrome/browser/gtk/keyword_editor_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698