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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc

Issue 16374006: Place browser-modal dialogs like web-contents-modal dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert changes to c/b/chromeos files for now. Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/confirm_bubble_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/bookmarks/bookmark_editor_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_editor_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "chrome/browser/bookmarks/bookmark_model.h" 14 #include "chrome/browser/bookmarks/bookmark_model.h"
15 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 15 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
16 #include "chrome/browser/bookmarks/bookmark_utils.h" 16 #include "chrome/browser/bookmarks/bookmark_utils.h"
17 #include "chrome/browser/history/history_service.h" 17 #include "chrome/browser/history/history_service.h"
18 #include "chrome/browser/net/url_fixer_upper.h" 18 #include "chrome/browser/net/url_fixer_upper.h"
19 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" 20 #include "chrome/browser/ui/bookmarks/bookmark_utils.h"
21 #include "chrome/browser/ui/views/constrained_window_views.h"
21 #include "components/user_prefs/user_prefs.h" 22 #include "components/user_prefs/user_prefs.h"
22 #include "googleurl/src/gurl.h" 23 #include "googleurl/src/gurl.h"
23 #include "grit/chromium_strings.h" 24 #include "grit/chromium_strings.h"
24 #include "grit/generated_resources.h" 25 #include "grit/generated_resources.h"
25 #include "grit/locale_settings.h" 26 #include "grit/locale_settings.h"
26 #include "ui/base/events/event.h" 27 #include "ui/base/events/event.h"
27 #include "ui/base/l10n/l10n_util.h" 28 #include "ui/base/l10n/l10n_util.h"
28 #include "ui/views/background.h" 29 #include "ui/views/background.h"
29 #include "ui/views/controls/button/label_button.h" 30 #include "ui/views/controls/button/label_button.h"
30 #include "ui/views/controls/label.h" 31 #include "ui/views/controls/label.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 deletes_.push_back(node->value); 212 deletes_.push_back(node->value);
212 } 213 }
213 tree_model_->Remove(node->parent(), node); 214 tree_model_->Remove(node->parent(), node);
214 } else { 215 } else {
215 DCHECK_EQ(IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM, command_id); 216 DCHECK_EQ(IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM, command_id);
216 NewFolder(); 217 NewFolder();
217 } 218 }
218 } 219 }
219 220
220 void BookmarkEditorView::Show(gfx::NativeWindow parent) { 221 void BookmarkEditorView::Show(gfx::NativeWindow parent) {
221 views::DialogDelegate::CreateDialogWidget(this, NULL, parent); 222 CreateBrowserModalDialogViews(this, parent);
222 UserInputChanged(); 223 UserInputChanged();
223 if (show_tree_ && bb_model_->loaded()) 224 if (show_tree_ && bb_model_->loaded())
224 ExpandAndSelect(); 225 ExpandAndSelect();
225 GetWidget()->Show(); 226 GetWidget()->Show();
226 // Select all the text in the name Textfield. 227 // Select all the text in the name Textfield.
227 title_tf_->SelectAll(true); 228 title_tf_->SelectAll(true);
228 // Give focus to the name Textfield. 229 // Give focus to the name Textfield.
229 title_tf_->RequestFocus(); 230 title_tf_->RequestFocus();
230 } 231 }
231 232
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM); 623 IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM);
623 } 624 }
624 return context_menu_model_.get(); 625 return context_menu_model_.get();
625 } 626 }
626 627
627 void BookmarkEditorView::EditorTreeModel::SetTitle(ui::TreeModelNode* node, 628 void BookmarkEditorView::EditorTreeModel::SetTitle(ui::TreeModelNode* node,
628 const string16& title) { 629 const string16& title) {
629 if (!title.empty()) 630 if (!title.empty())
630 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); 631 ui::TreeNodeModel<EditorNode>::SetTitle(node, title);
631 } 632 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/confirm_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698