diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-23 23:00:17 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-23 23:00:17 +0000 |
commit | f9c773362c778437308629ff41d117a1a1cdda81 (patch) | |
tree | ef680b3fde7340a63f56b613cd5fa151e157a1cd /chrome/browser/input_window_dialog.h | |
parent | c3c656369b267ecc86962085af5202764012c72d (diff) | |
download | chromium_src-f9c773362c778437308629ff41d117a1a1cdda81.zip chromium_src-f9c773362c778437308629ff41d117a1a1cdda81.tar.gz chromium_src-f9c773362c778437308629ff41d117a1a1cdda81.tar.bz2 |
Adds (non-working) folders and GTK dialogs.
- Folders can be created and edited in the bookmark bar. They
aren't drop targets nor do they popup a menu with their contents.
- Refactor the input window interface to be platform neutral
and use that in EditFolderController.
Review URL: http://codereview.chromium.org/87010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14371 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/input_window_dialog.h')
-rw-r--r-- | chrome/browser/input_window_dialog.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/chrome/browser/input_window_dialog.h b/chrome/browser/input_window_dialog.h new file mode 100644 index 0000000..5229c1b --- /dev/null +++ b/chrome/browser/input_window_dialog.h @@ -0,0 +1,52 @@ +// 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_INPUT_WINDOW_DIALOG_H_ +#define CHROME_BROWSER_INPUT_WINDOW_DIALOG_H_ + +#include <string> + +#include "base/basictypes.h" +#include "base/gfx/native_widget_types.h" + +// Cross platform access to a modal input window. +class InputWindowDialog { + public: + class Delegate { + public: + virtual ~Delegate() { } + + // Checks whether |text| is a valid input string. + virtual bool IsValid(const std::wstring& text) = 0; + + // Callback for when the user clicks the OK button. + virtual void InputAccepted(const std::wstring& text) = 0; + + // Callback for when the user clicks the Cancel button. + virtual void InputCanceled() = 0; + }; + + // Creates a new input window dialog from the parent window + // |parent|, Ownership of |delegate| is taken by InputWindowDialog or + // InputWindowDialog's owner. + static InputWindowDialog* Create(gfx::NativeWindow parent, + const std::wstring& window_title, + const std::wstring& label, + const std::wstring& contents, + Delegate* delegate); + + // Displays the window. + virtual void Show() = 0; + + // Closes the window. + virtual void Close() = 0; + + protected: + InputWindowDialog() { } + + private: + DISALLOW_COPY_AND_ASSIGN(InputWindowDialog); +}; + +#endif // CHROME_BROWSER_INPUT_WINDOW_DIALOG_H_ |