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

Unified Diff: chrome/browser/ui/gtk/edit_search_engine_dialog.h

Issue 6099014: Move chrome/browser/gtk to chrome/browser/ui/gtk (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Move browser/gtk/ to browser/ui/gtk/, leave header stubs, update new header guards Created 9 years, 11 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/gtk/edit_search_engine_dialog.h
diff --git a/chrome/browser/ui/gtk/edit_search_engine_dialog.h b/chrome/browser/ui/gtk/edit_search_engine_dialog.h
new file mode 100644
index 0000000000000000000000000000000000000000..fcad8dc393c0e300cc2e5ea5f08ade817f79de21
--- /dev/null
+++ b/chrome/browser/ui/gtk/edit_search_engine_dialog.h
@@ -0,0 +1,83 @@
+// Copyright (c) 2010 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_GTK_EDIT_SEARCH_ENGINE_DIALOG_H_
+#define CHROME_BROWSER_UI_GTK_EDIT_SEARCH_ENGINE_DIALOG_H_
+#pragma once
+
+#include <gtk/gtk.h>
+#include <string>
+
+#include "app/gtk_signal.h"
+#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
+#include "base/string16.h"
+
+class AccessibleWidgetHelper;
+class EditSearchEngineController;
+class EditSearchEngineControllerDelegate;
+class Profile;
+class TemplateURL;
+
+class EditSearchEngineDialog {
+ public:
+ EditSearchEngineDialog(GtkWindow* parent_window,
+ const TemplateURL* template_url,
+ EditSearchEngineControllerDelegate* delegate,
+ Profile* profile);
+ virtual ~EditSearchEngineDialog();
+
+ private:
+ // Create and show the window.
+ void Init(GtkWindow* parent_window, Profile* profile);
+
+ // Retrieve the user input in the various fields.
+ string16 GetTitleInput() const;
+ string16 GetKeywordInput() const;
+ std::string GetURLInput() const;
+
+ // Set sensitivity of buttons based on entry state.
+ void EnableControls();
+
+ // Updates the tooltip and image of the image view based on is_valid. If
+ // is_valid is false the tooltip of the image view is set to the message with
+ // id invalid_message_id, otherwise the tooltip is set to the empty text.
+ void UpdateImage(GtkWidget* image, bool is_valid, int invalid_message_id);
+
+ // Callback for entry changes.
+ CHROMEG_CALLBACK_0(EditSearchEngineDialog, void, OnEntryChanged,
+ GtkEditable*);
+
+ // Callback for dialog buttons.
+ CHROMEG_CALLBACK_1(EditSearchEngineDialog, void, OnResponse, GtkDialog*, int);
+
+ // Callback for window destruction.
+ CHROMEGTK_CALLBACK_0(EditSearchEngineDialog, void, OnWindowDestroy);
+
+ // The dialog window.
+ GtkWidget* dialog_;
+
+ // Text entries for each field.
+ GtkWidget* title_entry_;
+ GtkWidget* keyword_entry_;
+ GtkWidget* url_entry_;
+
+ // Images showing whether each entry is okay or has errors.
+ GtkWidget* title_image_;
+ GtkWidget* keyword_image_;
+ GtkWidget* url_image_;
+
+ // The ok button (we need a reference to it so we can de-activate it when the
+ // entries are not all filled in.)
+ GtkWidget* ok_button_;
+
+ scoped_ptr<EditSearchEngineController> controller_;
+
+ // Helper object to manage accessibility metadata.
+ scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_;
+
+ DISALLOW_COPY_AND_ASSIGN(EditSearchEngineDialog);
+};
+
+#endif // CHROME_BROWSER_UI_GTK_EDIT_SEARCH_ENGINE_DIALOG_H_
« no previous file with comments | « chrome/browser/ui/gtk/download_started_animation_gtk.cc ('k') | chrome/browser/ui/gtk/edit_search_engine_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698