diff options
author | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-16 22:31:20 +0000 |
---|---|---|
committer | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-16 22:31:20 +0000 |
commit | 5378cba66c81d623727ba892f18deefd46ad2cfd (patch) | |
tree | 7b5205c3a39fd0a771897d99c5d52a19cdcfdb41 /chrome/browser/bookmarks/bookmark_editor.h | |
parent | 0b5758bec975a7df298660a6c95ab573d3b589ec (diff) | |
download | chromium_src-5378cba66c81d623727ba892f18deefd46ad2cfd.zip chromium_src-5378cba66c81d623727ba892f18deefd46ad2cfd.tar.gz chromium_src-5378cba66c81d623727ba892f18deefd46ad2cfd.tar.bz2 |
Revert 101581 - Add --use-more-webui runtime flag to toggle WebUI replacements for native dialogs.
Reason for revert: Broke compile on linux touch.
This adds the flag --use-more-webui to allow turning on WebUI replacements for native dialogs. This flag is automatically set when --use-pure-views is specified. Modifies replaced native dialogs to be toggled based on flag value. BookmarkEditor has also been refactored to use static constructors to EditDetails to describe what is being edited to make the code more readable.
BUG=None
TEST=Tested that webui dialogs can be turned on or left off with --use-more-webui.
Review URL: http://codereview.chromium.org/7670041
TBR=flackr@chromium.org
Review URL: http://codereview.chromium.org/7919028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks/bookmark_editor.h')
-rw-r--r-- | chrome/browser/bookmarks/bookmark_editor.h | 44 |
1 files changed, 8 insertions, 36 deletions
diff --git a/chrome/browser/bookmarks/bookmark_editor.h b/chrome/browser/bookmarks/bookmark_editor.h index 5b3a6ab..39e99ea 100644 --- a/chrome/browser/bookmarks/bookmark_editor.h +++ b/chrome/browser/bookmarks/bookmark_editor.h @@ -27,19 +27,7 @@ class BookmarkEditor { }; // Describes what the user is editing. - class EditDetails { - public: - // Returns an EditDetails instance for the user editing the given bookmark. - static EditDetails EditNode(const BookmarkNode* node); - - // Returns an EditDetails instance for the user adding a bookmark within - // a given parent node. - static EditDetails AddNodeInFolder(const BookmarkNode* parent_node); - - // Returns an EditDetails instance for the user adding a folder within a - // given parent node. - static EditDetails AddFolder(const BookmarkNode* parent_node); - + struct EditDetails { enum Type { // The user is editing an existing node in the model. The node the user // is editing is set in |existing_node|. @@ -55,50 +43,34 @@ class BookmarkEditor { NEW_FOLDER }; + EditDetails(); + explicit EditDetails(const BookmarkNode* node); ~EditDetails(); // See description of enum value for details. - const Type type; + Type type; // If type == EXISTING_NODE this gives the existing node. const BookmarkNode* existing_node; - // If type == NEW_URL or type == NEW_FOLDER this gives the parent node - // to place the new node in. - const BookmarkNode* parent_node; - // If type == NEW_FOLDER, this is the urls/title pairs to add to the // folder. std::vector<std::pair<GURL, string16> > urls; - - private: - explicit EditDetails(Type node_type); }; - // Shows the bookmark editor. If --use-more-webui is enabled use the bookmark - // manager to add or edit bookmarks. The bookmark editor allows editing an + // Shows the bookmark editor. The bookmark editor allows editing an // existing node or creating a new bookmark node (as determined by // |details.type|). If |configuration| is SHOW_TREE, a tree is shown allowing // the user to choose the parent of the node. // |parent| gives the initial parent to select in the tree for the node. // |parent| is only used if |details.existing_node| is null. + // TODO(flackr): Rename this to ShowNative and add cross platform Show method + // which will show a WebUI version of the dialog if --pure-views is set. static void Show(gfx::NativeWindow parent_window, Profile* profile, + const BookmarkNode* parent, const EditDetails& details, Configuration configuration); - - private: - // Shows the native bookmark editor. - // TODO(flackr): Remove parent argument. - static void ShowNative(gfx::NativeWindow parent_window, - Profile* profile, - const BookmarkNode* parent, - const EditDetails& details, - Configuration configuration); - - // Shows the WebUI bookmark editor. - static void ShowWebUI(Profile* profile, - const EditDetails& details); }; #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_EDITOR_H_ |