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

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

Issue 9665008: views: Nuke is_mouse_gesture parameter from ContextMenuController::ShowContextMenuForView(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
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"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 title_tf_.SelectAll(); 272 title_tf_.SelectAll();
273 // Give focus to the name Textfield. 273 // Give focus to the name Textfield.
274 title_tf_.RequestFocus(); 274 title_tf_.RequestFocus();
275 } 275 }
276 276
277 void BookmarkEditorView::Close() { 277 void BookmarkEditorView::Close() {
278 DCHECK(GetWidget()); 278 DCHECK(GetWidget());
279 GetWidget()->Close(); 279 GetWidget()->Close();
280 } 280 }
281 281
282 void BookmarkEditorView::ShowContextMenuForView(View* source, 282 void BookmarkEditorView::ShowContextMenuForView(
283 const gfx::Point& p, 283 views::View* source,
284 bool is_mouse_gesture) { 284 const gfx::Point& point,
285 views::GestureType gesture_type) {
285 DCHECK(source == tree_view_); 286 DCHECK(source == tree_view_);
286 if (!tree_view_->GetSelectedNode()) 287 if (!tree_view_->GetSelectedNode())
287 return; 288 return;
288 running_menu_for_root_ = 289 running_menu_for_root_ =
289 (tree_model_->GetParent(tree_view_->GetSelectedNode()) == 290 (tree_model_->GetParent(tree_view_->GetSelectedNode()) ==
290 tree_model_->GetRoot()); 291 tree_model_->GetRoot());
291 #if defined(USE_AURA) 292 #if defined(USE_AURA)
292 NOTIMPLEMENTED(); 293 NOTIMPLEMENTED();
293 #else 294 #else
294 if (!context_menu_contents_.get()) { 295 if (!context_menu_contents_.get()) {
295 context_menu_contents_.reset(new ui::SimpleMenuModel(this)); 296 context_menu_contents_.reset(new ui::SimpleMenuModel(this));
296 context_menu_contents_->AddItemWithStringId(IDS_EDIT, IDS_EDIT); 297 context_menu_contents_->AddItemWithStringId(IDS_EDIT, IDS_EDIT);
297 context_menu_contents_->AddItemWithStringId(IDS_DELETE, IDS_DELETE); 298 context_menu_contents_->AddItemWithStringId(IDS_DELETE, IDS_DELETE);
298 context_menu_contents_->AddItemWithStringId( 299 context_menu_contents_->AddItemWithStringId(
299 IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM, 300 IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM,
300 IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM); 301 IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM);
301 context_menu_.reset(new views::Menu2(context_menu_contents_.get())); 302 context_menu_.reset(new views::Menu2(context_menu_contents_.get()));
302 } 303 }
303 context_menu_->RunContextMenuAt(p); 304 context_menu_->RunContextMenuAt(point);
304 #endif 305 #endif
305 } 306 }
306 307
307 void BookmarkEditorView::Init() { 308 void BookmarkEditorView::Init() {
308 bb_model_ = profile_->GetBookmarkModel(); 309 bb_model_ = profile_->GetBookmarkModel();
309 DCHECK(bb_model_); 310 DCHECK(bb_model_);
310 bb_model_->AddObserver(this); 311 bb_model_->AddObserver(this);
311 312
312 title_tf_.set_parent_owned(false); 313 title_tf_.set_parent_owned(false);
313 314
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 expanded_nodes->insert(bb_model_->GetNodeByID(editor_node->value)); 669 expanded_nodes->insert(bb_model_->GetNodeByID(editor_node->value));
669 for (int i = 0; i < editor_node->child_count(); ++i) 670 for (int i = 0; i < editor_node->child_count(); ++i)
670 UpdateExpandedNodes(editor_node->GetChild(i), expanded_nodes); 671 UpdateExpandedNodes(editor_node->GetChild(i), expanded_nodes);
671 } 672 }
672 673
673 void BookmarkEditorView::EditorTreeModel::SetTitle(ui::TreeModelNode* node, 674 void BookmarkEditorView::EditorTreeModel::SetTitle(ui::TreeModelNode* node,
674 const string16& title) { 675 const string16& title) {
675 if (!title.empty()) 676 if (!title.empty())
676 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); 677 ui::TreeNodeModel<EditorNode>::SetTitle(node, title);
677 } 678 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698