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

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

Issue 2785683003: views: implement width snapping for DialogDelegateViews (Closed)
Patch Set: Created 3 years, 8 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
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/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 url_tf_->SelectAll(true); 125 url_tf_->SelectAll(true);
126 url_tf_->RequestFocus(); 126 url_tf_->RequestFocus();
127 } 127 }
128 return false; 128 return false;
129 } 129 }
130 // Otherwise save changes and close the dialog box. 130 // Otherwise save changes and close the dialog box.
131 ApplyEdits(); 131 ApplyEdits();
132 return true; 132 return true;
133 } 133 }
134 134
135 gfx::Size BookmarkEditorView::GetPreferredSize() const { 135 gfx::Size BookmarkEditorView::GetUnsnappedPreferredSize() const {
136 if (!show_tree_) 136 if (!show_tree_)
137 return views::View::GetPreferredSize(); 137 return views::View::GetPreferredSize();
138 138
139 return gfx::Size(views::Widget::GetLocalizedContentsSize( 139 return gfx::Size(views::Widget::GetLocalizedContentsSize(
140 IDS_EDITBOOKMARK_DIALOG_WIDTH_CHARS, 140 IDS_EDITBOOKMARK_DIALOG_WIDTH_CHARS,
141 IDS_EDITBOOKMARK_DIALOG_HEIGHT_LINES)); 141 IDS_EDITBOOKMARK_DIALOG_HEIGHT_LINES));
Peter Kasting 2017/03/30 00:35:34 Hmm. This isn't the right way to size this dialog
142 } 142 }
143 143
144 void BookmarkEditorView::OnTreeViewSelectionChanged( 144 void BookmarkEditorView::OnTreeViewSelectionChanged(
145 views::TreeView* tree_view) { 145 views::TreeView* tree_view) {
146 } 146 }
147 147
148 bool BookmarkEditorView::CanEdit(views::TreeView* tree_view, 148 bool BookmarkEditorView::CanEdit(views::TreeView* tree_view,
149 ui::TreeModelNode* node) { 149 ui::TreeModelNode* node) {
150 // Only allow editting of children of the bookmark bar node and other node. 150 // Only allow editting of children of the bookmark bar node and other node.
151 EditorNode* bb_node = tree_model_->AsNode(node); 151 EditorNode* bb_node = tree_model_->AsNode(node);
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 Profile* profile, 676 Profile* profile,
677 const BookmarkEditor::EditDetails& details, 677 const BookmarkEditor::EditDetails& details,
678 BookmarkEditor::Configuration configuration) { 678 BookmarkEditor::Configuration configuration) {
679 DCHECK(profile); 679 DCHECK(profile);
680 BookmarkEditorView* editor = new BookmarkEditorView( 680 BookmarkEditorView* editor = new BookmarkEditorView(
681 profile, details.parent_node, details, configuration); 681 profile, details.parent_node, details, configuration);
682 editor->Show(parent_window); 682 editor->Show(parent_window);
683 } 683 }
684 684
685 } // namespace chrome 685 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698