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

Unified Diff: chrome/browser/bookmarks/bookmark_editor.cc

Issue 7670041: Add --use-more-webui runtime flag to toggle WebUI replacements for native dialogs. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge with trunk. Created 9 years, 3 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
« no previous file with comments | « chrome/browser/bookmarks/bookmark_editor.h ('k') | chrome/browser/browser_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_editor.cc
diff --git a/chrome/browser/bookmarks/bookmark_editor.cc b/chrome/browser/bookmarks/bookmark_editor.cc
index 2e940fcfc9c6b5313b27854fd008cf9da45cde02..521f441e9881c01041d4d16b6a224d5804f521df 100644
--- a/chrome/browser/bookmarks/bookmark_editor.cc
+++ b/chrome/browser/bookmarks/bookmark_editor.cc
@@ -1,20 +1,52 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
#include "chrome/browser/bookmarks/bookmark_editor.h"
+#include "chrome/browser/bookmarks/bookmark_model.h"
+#include "chrome/browser/ui/webui/chrome_web_ui.h"
-#include "googleurl/src/gurl.h"
+BookmarkEditor::EditDetails::EditDetails(Type node_type)
+ : type(node_type) {
+}
+
+BookmarkEditor::EditDetails BookmarkEditor::EditDetails::EditNode(
+ const BookmarkNode* node) {
+ EditDetails details(EXISTING_NODE);
+ details.existing_node = node;
+ return details;
+}
-BookmarkEditor::EditDetails::EditDetails()
- : type(NEW_URL),
- existing_node(NULL) {
+BookmarkEditor::EditDetails BookmarkEditor::EditDetails::AddNodeInFolder(
+ const BookmarkNode* parent_node) {
+ EditDetails details(NEW_URL);
+ details.parent_node = parent_node;
+ return details;
}
-BookmarkEditor::EditDetails::EditDetails(const BookmarkNode* node)
- : type(EXISTING_NODE),
- existing_node(node) {
+BookmarkEditor::EditDetails BookmarkEditor::EditDetails::AddFolder(
+ const BookmarkNode* parent_node) {
+ EditDetails details(NEW_FOLDER);
+ details.parent_node = parent_node;
+ return details;
}
BookmarkEditor::EditDetails::~EditDetails() {
}
+
+void BookmarkEditor::Show(gfx::NativeWindow parent_window,
+ Profile* profile,
+ const EditDetails& details,
+ Configuration configuration) {
+ // TODO(flackr): Implement NEW_FOLDER type in WebUI and remove the type check.
+ if (ChromeWebUI::IsMoreWebUI() && (
+ details.type == EditDetails::EXISTING_NODE ||
+ details.type == EditDetails::NEW_URL)) {
+ ShowWebUI(profile, details);
+ return;
+ }
+
+ // Delegate to the platform native bookmark editor code.
+ ShowNative(parent_window, profile, details.parent_node, details,
+ configuration);
+}
« no previous file with comments | « chrome/browser/bookmarks/bookmark_editor.h ('k') | chrome/browser/browser_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698