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

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

Issue 8438037: Change 'Add Page' to show a simple input dialog with --use-more-webui. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address comments Created 9 years, 1 month 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/bookmarks/bookmark_editor.cc
diff --git a/chrome/browser/bookmarks/bookmark_editor.cc b/chrome/browser/bookmarks/bookmark_editor.cc
index 78013fbed27132c647cae3b1fe55dfe707cfe439..ad17386994a531e811ce44a1ca8d6247857fae80 100644
--- a/chrome/browser/bookmarks/bookmark_editor.cc
+++ b/chrome/browser/bookmarks/bookmark_editor.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "chrome/browser/bookmarks/bookmark_editor.h"
+#include "chrome/browser/bookmarks/bookmark_input_window_dialog_controller.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/ui/webui/chrome_web_ui.h"
@@ -20,16 +21,20 @@ BookmarkEditor::EditDetails BookmarkEditor::EditDetails::EditNode(
}
BookmarkEditor::EditDetails BookmarkEditor::EditDetails::AddNodeInFolder(
- const BookmarkNode* parent_node) {
+ const BookmarkNode* parent_node,
+ int index) {
EditDetails details(NEW_URL);
details.parent_node = parent_node;
+ details.index = index;
return details;
}
BookmarkEditor::EditDetails BookmarkEditor::EditDetails::AddFolder(
- const BookmarkNode* parent_node) {
+ const BookmarkNode* parent_node,
+ int index) {
EditDetails details(NEW_FOLDER);
details.parent_node = parent_node;
+ details.index = index;
return details;
}
@@ -43,16 +48,19 @@ void BookmarkEditor::Show(gfx::NativeWindow parent_window,
#if defined(USE_AURA)
// TODO(saintlou): Aura uses always "more WebUI". Remove test when flackr is
// done as per his note below.
- if (details.type == EditDetails::EXISTING_NODE ||
- details.type == EditDetails::NEW_URL) {
- ShowWebUI(profile, details);
+ if (details.type != EditDetails::NEW_FOLDER || details.urls.empty()) {
+ BookmarkInputWindowDialogController::Show(profile, parent_window, details);
}
#else
- // 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);
+ // TODO(flackr): Implement NEW_FOLDER type with non-empty |details.urls| in
+ // WebUI and remove the type check.
+ if ((ChromeWebUI::IsMoreWebUI() &&
+ (details.type != EditDetails::NEW_FOLDER || details.urls.empty())) ||
+ (details.type == EditDetails::EXISTING_NODE &&
+ details.existing_node->is_folder()) ||
+ (details.type == EditDetails::NEW_FOLDER &&
+ details.urls.empty())) {
+ BookmarkInputWindowDialogController::Show(profile, parent_window, details);
return;
}
« no previous file with comments | « chrome/browser/bookmarks/bookmark_editor.h ('k') | chrome/browser/bookmarks/bookmark_folder_editor_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698