diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-08 20:56:54 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-08 20:56:54 +0000 |
commit | b3ac5c830a92eecabb94160169e72415d59a5509 (patch) | |
tree | 516d1fe562c060b0a6a04a2796c3909b2646b601 /chrome/browser/views | |
parent | 378c3fdf56d3f6328632f0e994a678c9387c78d3 (diff) | |
download | chromium_src-b3ac5c830a92eecabb94160169e72415d59a5509.zip chromium_src-b3ac5c830a92eecabb94160169e72415d59a5509.tar.gz chromium_src-b3ac5c830a92eecabb94160169e72415d59a5509.tar.bz2 |
Adds the ability to create a bookmark folder populated with a bookmark
for each open tab. I've currently wired this up on windows, will wire
up rest of platforms in a separate cl.
BUG=2935
TEST=on Windows open multiple tabs, right click on a tab and choose
'Bookmark all tabs'. You should then get the bookmark editor with no
url field. Accepting the dialog should result in creating a new folder
with a bookmark for each of the open tabs.
Review URL: http://codereview.chromium.org/270021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/bookmark_editor_view.cc | 30 | ||||
-rw-r--r-- | chrome/browser/views/bookmark_editor_view.h | 60 | ||||
-rw-r--r-- | chrome/browser/views/bookmark_editor_view_unittest.cc | 174 | ||||
-rw-r--r-- | chrome/browser/views/tabs/tab.cc | 10 |
4 files changed, 190 insertions, 84 deletions
diff --git a/chrome/browser/views/bookmark_editor_view.cc b/chrome/browser/views/bookmark_editor_view.cc index bf47ec4..42d6447 100644 --- a/chrome/browser/views/bookmark_editor_view.cc +++ b/chrome/browser/views/bookmark_editor_view.cc @@ -87,11 +87,15 @@ BookmarkEditorView::~BookmarkEditorView() { bool BookmarkEditorView::IsDialogButtonEnabled( MessageBoxFlags::DialogButton button) const { if (button == MessageBoxFlags::DIALOGBUTTON_OK) { + if (IsEditingFolder()) + return !title_tf_.text().empty(); + const GURL url(GetInputURL()); return bb_model_->IsLoaded() && url.is_valid(); } return true; } + bool BookmarkEditorView::IsModal() const { return true; } @@ -263,7 +267,7 @@ void BookmarkEditorView::Init() { title_tf_.SetController(this); std::wstring url_text; - if (node_) { + if (node_ && !IsEditingFolder()) { std::wstring languages = profile_ ? profile_->GetPrefs()->GetString(prefs::kAcceptLanguages) : std::wstring(); @@ -271,7 +275,7 @@ void BookmarkEditorView::Init() { // false and unescape=false to show the original URL except IDN. url_text = net::FormatUrl(node_->GetURL(), languages, false, UnescapeRule::NONE, - NULL, NULL); + NULL, NULL); } url_tf_.SetText(url_text); url_tf_.SetController(this); @@ -323,12 +327,14 @@ void BookmarkEditorView::Init() { new Label(l10n_util::GetString(IDS_BOOMARK_EDITOR_NAME_LABEL))); layout->AddView(&title_tf_); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); + if (!IsEditingFolder()) { + layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - layout->StartRow(0, labels_column_set_id); - layout->AddView( - new Label(l10n_util::GetString(IDS_BOOMARK_EDITOR_URL_LABEL))); - layout->AddView(&url_tf_); + layout->StartRow(0, labels_column_set_id); + layout->AddView( + new Label(l10n_util::GetString(IDS_BOOMARK_EDITOR_URL_LABEL))); + layout->AddView(&url_tf_); + } if (show_tree_) { layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); @@ -441,12 +447,15 @@ BookmarkEditorView::EditorNode* BookmarkEditorView::AddNewGroup( return new_node; } +bool BookmarkEditorView::IsEditingFolder() const { + return node_ && node_->is_folder(); +} + void BookmarkEditorView::ExpandAndSelect() { tree_view_->ExpandAll(); const BookmarkNode* to_select = node_ ? node_->GetParent() : parent_; int64 group_id_to_select = to_select->id(); - DCHECK(group_id_to_select); // GetMostRecentParent should never return NULL. EditorNode* b_node = FindNodeWithID(tree_model_->GetRoot(), group_id_to_select); if (!b_node) @@ -469,9 +478,10 @@ void BookmarkEditorView::CreateNodes(const BookmarkNode* bb_node, BookmarkEditorView::EditorNode* b_node) { for (int i = 0; i < bb_node->GetChildCount(); ++i) { const BookmarkNode* child_bb_node = bb_node->GetChild(i); - if (child_bb_node->is_folder()) { + if (child_bb_node->is_folder() && + (!IsEditingFolder() || child_bb_node != node_)) { EditorNode* new_b_node = new EditorNode(child_bb_node->GetTitle(), - child_bb_node->id()); + child_bb_node->id()); b_node->Add(b_node->GetChildCount(), new_b_node); CreateNodes(child_bb_node, new_b_node); } diff --git a/chrome/browser/views/bookmark_editor_view.h b/chrome/browser/views/bookmark_editor_view.h index 0b1ae90..571c9ff 100644 --- a/chrome/browser/views/bookmark_editor_view.h +++ b/chrome/browser/views/bookmark_editor_view.h @@ -22,13 +22,16 @@ class NativeButton; class Window; } +class BookmarkEditorViewTest; class GURL; class Menu; class Profile; // View that allows the user to edit a bookmark/starred URL. The user can // change the URL, title and where the bookmark appears as well as adding -// new groups and changing the name of other groups. +// new groups and changing the name of other groups. The editor is used for +// both editing a url bookmark, as well as editing a folder bookmark when +// created from 'Bookmark all tabs'. // // Edits are applied to the BookmarkModel when the user presses 'OK'. // @@ -43,17 +46,27 @@ class BookmarkEditorView : public BookmarkEditor, public views::ContextMenuController, public views::SimpleMenuModel::Delegate, public BookmarkModelObserver { - FRIEND_TEST(BookmarkEditorViewTest, ChangeParent); - FRIEND_TEST(BookmarkEditorViewTest, ChangeParentAndURL); - FRIEND_TEST(BookmarkEditorViewTest, ChangeURLToExistingURL); - FRIEND_TEST(BookmarkEditorViewTest, EditTitleKeepsPosition); - FRIEND_TEST(BookmarkEditorViewTest, EditURLKeepsPosition); - FRIEND_TEST(BookmarkEditorViewTest, ModelsMatch); - FRIEND_TEST(BookmarkEditorViewTest, MoveToNewParent); - FRIEND_TEST(BookmarkEditorViewTest, NewURL); - FRIEND_TEST(BookmarkEditorViewTest, ChangeURLNoTree); - FRIEND_TEST(BookmarkEditorViewTest, ChangeTitleNoTree); public: + // Type of node in the tree. Public purely for testing. + typedef TreeNodeWithValue<int64> EditorNode; + + // Model for the TreeView. Trivial subclass that doesn't allow titles with + // empty strings. Public purely for testing. + class EditorTreeModel : public TreeNodeModel<EditorNode> { + public: + explicit EditorTreeModel(EditorNode* root) + : TreeNodeModel<EditorNode>(root) {} + + virtual void SetTitle(TreeModelNode* node, + const std::wstring& title) { + if (!title.empty()) + TreeNodeModel::SetTitle(node, title); + } + + private: + DISALLOW_COPY_AND_ASSIGN(EditorTreeModel); + }; + BookmarkEditorView(Profile* profile, const BookmarkNode* parent, const BookmarkNode* node, @@ -113,25 +126,7 @@ class BookmarkEditorView : public BookmarkEditor, bool is_mouse_gesture); private: - // Type of node in the tree. - typedef TreeNodeWithValue<int64> EditorNode; - - // Model for the TreeView. Trivial subclass that doesn't allow titles with - // empty strings. - class EditorTreeModel : public TreeNodeModel<EditorNode> { - public: - explicit EditorTreeModel(EditorNode* root) - : TreeNodeModel<EditorNode>(root) {} - - virtual void SetTitle(TreeModelNode* node, - const std::wstring& title) { - if (!title.empty()) - TreeNodeModel::SetTitle(node, title); - } - - private: - DISALLOW_COPY_AND_ASSIGN(EditorTreeModel); - }; + friend class BookmarkEditorViewTest; // Creates the necessary sub-views, configures them, adds them to the layout, // and requests the entries to display from the database. @@ -172,7 +167,7 @@ class BookmarkEditorView : public BookmarkEditor, EditorNode* CreateRootNode(); // Adds and creates a child node in b_node for all children of bb_node that - // are groups. + // are groups, except for |node_| if editing a folder. void CreateNodes(const BookmarkNode* bb_node, EditorNode* b_node); // Returns the node with the specified id, or NULL if one can't be found. @@ -220,6 +215,9 @@ class BookmarkEditorView : public BookmarkEditor, // internally by NewGroup and broken into a separate method for testing. EditorNode* AddNewGroup(EditorNode* parent); + // Returns true if editing a folder. + bool IsEditingFolder() const; + // Profile the entry is from. Profile* profile_; diff --git a/chrome/browser/views/bookmark_editor_view_unittest.cc b/chrome/browser/views/bookmark_editor_view_unittest.cc index 22570bb..789e1ee1 100644 --- a/chrome/browser/views/bookmark_editor_view_unittest.cc +++ b/chrome/browser/views/bookmark_editor_view_unittest.cc @@ -49,6 +49,40 @@ class BookmarkEditorViewTest : public testing::Test { return const_cast<BookmarkNode*>(GetNode(name)); } + BookmarkEditorView::EditorTreeModel* editor_tree_model() { + return editor_->tree_model_.get(); + } + + void CreateEditor(Profile* profile, + const BookmarkNode* parent, + const BookmarkNode* node, + BookmarkEditor::Configuration configuration, + BookmarkEditor::Handler* handler) { + editor_.reset(new BookmarkEditorView(profile, parent, node, configuration, + handler)); + } + + void SetTitleText(const std::wstring& title) { + editor_->title_tf_.SetText(title); + } + + void SetURLText(const std::wstring& text) { + editor_->url_tf_.SetText(text); + } + + void ApplyEdits(BookmarkEditorView::EditorNode* node) { + editor_->ApplyEdits(node); + } + + BookmarkEditorView::EditorNode* AddNewGroup( + BookmarkEditorView::EditorNode* parent) { + return editor_->AddNewGroup(parent); + } + + bool URLTFHasParent() { + return editor_->url_tf_.GetParent(); + } + private: // Creates the following structure: // bookmark bar node @@ -81,13 +115,15 @@ class BookmarkEditorViewTest : public testing::Test { model_->AddGroup(model_->other_node(), 1, L"OF1"); model_->AddURL(of1, 0, L"of1a", GURL(test_base + "of1a")); } + + scoped_ptr<BookmarkEditorView> editor_; }; // Makes sure the tree model matches that of the bookmark bar model. TEST_F(BookmarkEditorViewTest, ModelsMatch) { - BookmarkEditorView editor(profile_.get(), NULL, NULL, - BookmarkEditorView::SHOW_TREE, NULL); - BookmarkEditorView::EditorNode* editor_root = editor.tree_model_->GetRoot(); + CreateEditor(profile_.get(), NULL, NULL, BookmarkEditorView::SHOW_TREE, + NULL); + BookmarkEditorView::EditorNode* editor_root = editor_tree_model()->GetRoot(); // The root should have two children, one for the bookmark bar node, // the other for the 'other bookmarks' folder. ASSERT_EQ(2, editor_root->GetChildCount()); @@ -110,11 +146,11 @@ TEST_F(BookmarkEditorViewTest, ModelsMatch) { // Changes the title and makes sure parent/visual order doesn't change. TEST_F(BookmarkEditorViewTest, EditTitleKeepsPosition) { - BookmarkEditorView editor(profile_.get(), NULL, GetNode("a"), - BookmarkEditorView::SHOW_TREE, NULL); - editor.title_tf_.SetText(L"new_a"); + CreateEditor(profile_.get(), NULL, GetNode("a"), + BookmarkEditorView::SHOW_TREE, NULL); + SetTitleText(L"new_a"); - editor.ApplyEdits(editor.tree_model_->GetRoot()->GetChild(0)); + ApplyEdits(editor_tree_model()->GetRoot()->GetChild(0)); const BookmarkNode* bb_node = profile_->GetBookmarkModel()->GetBookmarkBarNode(); @@ -127,12 +163,12 @@ TEST_F(BookmarkEditorViewTest, EditTitleKeepsPosition) { TEST_F(BookmarkEditorViewTest, EditURLKeepsPosition) { Time node_time = Time::Now() + TimeDelta::FromDays(2); GetMutableNode("a")->set_date_added(node_time); - BookmarkEditorView editor(profile_.get(), NULL, GetNode("a"), - BookmarkEditorView::SHOW_TREE, NULL); + CreateEditor(profile_.get(), NULL, GetNode("a"), + BookmarkEditorView::SHOW_TREE, NULL); - editor.url_tf_.SetText(UTF8ToWide(GURL(base_path() + "new_a").spec())); + SetURLText(UTF8ToWide(GURL(base_path() + "new_a").spec())); - editor.ApplyEdits(editor.tree_model_->GetRoot()->GetChild(0)); + ApplyEdits(editor_tree_model()->GetRoot()->GetChild(0)); const BookmarkNode* bb_node = profile_->GetBookmarkModel()->GetBookmarkBarNode(); @@ -144,10 +180,10 @@ TEST_F(BookmarkEditorViewTest, EditURLKeepsPosition) { // Moves 'a' to be a child of the other node. TEST_F(BookmarkEditorViewTest, ChangeParent) { - BookmarkEditorView editor(profile_.get(), NULL, GetNode("a"), - BookmarkEditorView::SHOW_TREE, NULL); + CreateEditor(profile_.get(), NULL, GetNode("a"), + BookmarkEditorView::SHOW_TREE, NULL); - editor.ApplyEdits(editor.tree_model_->GetRoot()->GetChild(1)); + ApplyEdits(editor_tree_model()->GetRoot()->GetChild(1)); const BookmarkNode* other_node = profile_->GetBookmarkModel()->other_node(); ASSERT_EQ(L"a", other_node->GetChild(2)->GetTitle()); @@ -158,12 +194,12 @@ TEST_F(BookmarkEditorViewTest, ChangeParent) { TEST_F(BookmarkEditorViewTest, ChangeParentAndURL) { Time node_time = Time::Now() + TimeDelta::FromDays(2); GetMutableNode("a")->set_date_added(node_time); - BookmarkEditorView editor(profile_.get(), NULL, GetNode("a"), - BookmarkEditorView::SHOW_TREE, NULL); + CreateEditor(profile_.get(), NULL, GetNode("a"), + BookmarkEditorView::SHOW_TREE, NULL); - editor.url_tf_.SetText(UTF8ToWide(GURL(base_path() + "new_a").spec())); + SetURLText(UTF8ToWide(GURL(base_path() + "new_a").spec())); - editor.ApplyEdits(editor.tree_model_->GetRoot()->GetChild(1)); + ApplyEdits(editor_tree_model()->GetRoot()->GetChild(1)); const BookmarkNode* other_node = profile_->GetBookmarkModel()->other_node(); ASSERT_EQ(L"a", other_node->GetChild(2)->GetTitle()); @@ -173,19 +209,19 @@ TEST_F(BookmarkEditorViewTest, ChangeParentAndURL) { // Creates a new folder and moves a node to it. TEST_F(BookmarkEditorViewTest, MoveToNewParent) { - BookmarkEditorView editor(profile_.get(), NULL, GetNode("a"), - BookmarkEditorView::SHOW_TREE, NULL); + CreateEditor(profile_.get(), NULL, GetNode("a"), + BookmarkEditorView::SHOW_TREE, NULL); // Create two nodes: "F21" as a child of "F2" and "F211" as a child of "F21". BookmarkEditorView::EditorNode* f2 = - editor.tree_model_->GetRoot()->GetChild(0)->GetChild(1); - BookmarkEditorView::EditorNode* f21 = editor.AddNewGroup(f2); + editor_tree_model()->GetRoot()->GetChild(0)->GetChild(1); + BookmarkEditorView::EditorNode* f21 = AddNewGroup(f2); f21->SetTitle(L"F21"); - BookmarkEditorView::EditorNode* f211 = editor.AddNewGroup(f21); + BookmarkEditorView::EditorNode* f211 = AddNewGroup(f21); f211->SetTitle(L"F211"); // Parent the node to "F21". - editor.ApplyEdits(f2); + ApplyEdits(f2); const BookmarkNode* bb_node = profile_->GetBookmarkModel()->GetBookmarkBarNode(); @@ -206,13 +242,13 @@ TEST_F(BookmarkEditorViewTest, MoveToNewParent) { // Brings up the editor, creating a new URL on the bookmark bar. TEST_F(BookmarkEditorViewTest, NewURL) { - BookmarkEditorView editor(profile_.get(), NULL, NULL, - BookmarkEditorView::SHOW_TREE, NULL); + CreateEditor(profile_.get(), NULL, NULL, BookmarkEditorView::SHOW_TREE, + NULL); - editor.url_tf_.SetText(UTF8ToWide(GURL(base_path() + "a").spec())); - editor.title_tf_.SetText(L"new_a"); + SetURLText(UTF8ToWide(GURL(base_path() + "a").spec())); + SetTitleText(L"new_a"); - editor.ApplyEdits(editor.tree_model_->GetRoot()->GetChild(0)); + ApplyEdits(editor_tree_model()->GetRoot()->GetChild(0)); const BookmarkNode* bb_node = profile_->GetBookmarkModel()->GetBookmarkBarNode(); @@ -226,14 +262,13 @@ TEST_F(BookmarkEditorViewTest, NewURL) { // Brings up the editor with no tree and modifies the url. TEST_F(BookmarkEditorViewTest, ChangeURLNoTree) { - BookmarkEditorView editor(profile_.get(), NULL, - model_->other_node()->GetChild(0), - BookmarkEditorView::NO_TREE, NULL); + CreateEditor(profile_.get(), NULL, model_->other_node()->GetChild(0), + BookmarkEditorView::NO_TREE, NULL); - editor.url_tf_.SetText(UTF8ToWide(GURL(base_path() + "a").spec())); - editor.title_tf_.SetText(L"new_a"); + SetURLText(UTF8ToWide(GURL(base_path() + "a").spec())); + SetTitleText(L"new_a"); - editor.ApplyEdits(NULL); + ApplyEdits(NULL); const BookmarkNode* other_node = profile_->GetBookmarkModel()->other_node(); ASSERT_EQ(2, other_node->GetChildCount()); @@ -246,13 +281,12 @@ TEST_F(BookmarkEditorViewTest, ChangeURLNoTree) { // Brings up the editor with no tree and modifies only the title. TEST_F(BookmarkEditorViewTest, ChangeTitleNoTree) { - BookmarkEditorView editor(profile_.get(), NULL, - model_->other_node()->GetChild(0), - BookmarkEditorView::NO_TREE, NULL); + CreateEditor(profile_.get(), NULL, model_->other_node()->GetChild(0), + BookmarkEditorView::NO_TREE, NULL); - editor.title_tf_.SetText(L"new_a"); + SetTitleText(L"new_a"); - editor.ApplyEdits(NULL); + ApplyEdits(NULL); const BookmarkNode* other_node = profile_->GetBookmarkModel()->other_node(); ASSERT_EQ(2, other_node->GetChildCount()); @@ -261,3 +295,63 @@ TEST_F(BookmarkEditorViewTest, ChangeTitleNoTree) { EXPECT_EQ(L"new_a", new_node->GetTitle()); } + +// Modifies the title of a folder. +TEST_F(BookmarkEditorViewTest, ModifyFolderTitle) { + int64 start_id = model_->GetBookmarkBarNode()->GetChild(2)->id(); + CreateEditor(profile_.get(), NULL, model_->GetBookmarkBarNode()->GetChild(2), + BookmarkEditorView::SHOW_TREE, NULL); + + // The url field shouldn't be visible. + EXPECT_FALSE(URLTFHasParent()); + SetTitleText(L"new_F"); + + // Make sure the tree isn't showing the folder we're editing. + EXPECT_EQ(1, editor_tree_model()->GetRoot()->GetChild(0)->GetChildCount()); + + ApplyEdits(editor_tree_model()->GetRoot()->GetChild(0)); + + // Make sure the folder we edited is still there. + ASSERT_EQ(3, model_->GetBookmarkBarNode()->GetChildCount()); + EXPECT_EQ(start_id, model_->GetBookmarkBarNode()->GetChild(2)->id()); + EXPECT_TRUE(model_->GetBookmarkBarNode()->GetChild(2)->is_folder()); + EXPECT_EQ(L"new_F", model_->GetBookmarkBarNode()->GetChild(2)->GetTitle()); +} + +// Moves a folder. +TEST_F(BookmarkEditorViewTest, MoveFolder) { + const BookmarkNode* node = model_->GetBookmarkBarNode()->GetChild(2); + int64 start_id = node->id(); + CreateEditor(profile_.get(), NULL, node, BookmarkEditorView::SHOW_TREE, NULL); + + SetTitleText(L"new_F"); + + // Moves to the 'other' folder. + ApplyEdits(editor_tree_model()->GetRoot()->GetChild(1)); + + // Make sure the folder we edited is still there. + ASSERT_EQ(3, model_->other_node()->GetChildCount()); + EXPECT_EQ(node, model_->other_node()->GetChild(2)); + EXPECT_TRUE(node->is_folder()); + EXPECT_EQ(L"new_F", node->GetTitle()); +} + +// Moves a folder under a new folder. +TEST_F(BookmarkEditorViewTest, MoveFolderNewParent) { + const BookmarkNode* node = model_->GetBookmarkBarNode()->GetChild(2); + CreateEditor(profile_.get(), NULL, node, BookmarkEditorView::SHOW_TREE, NULL); + + BookmarkEditorView::EditorNode* other = + editor_tree_model()->GetRoot()->GetChild(1); + BookmarkEditorView::EditorNode* new_f = AddNewGroup(other); + new_f->SetTitle(L"new_f"); + + ApplyEdits(new_f); + + // Make sure the folder we edited is still there. + ASSERT_EQ(3, model_->other_node()->GetChildCount()); + const BookmarkNode* new_folder = model_->other_node()->GetChild(2); + EXPECT_EQ(L"new_f", new_folder->GetTitle()); + ASSERT_EQ(1, new_folder->GetChildCount()); + ASSERT_EQ(node, new_folder->GetChild(0)); +} diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc index 93d5cb2..9ff31b0 100644 --- a/chrome/browser/views/tabs/tab.cc +++ b/chrome/browser/views/tabs/tab.cc @@ -85,6 +85,8 @@ class Tab::TabContextMenuContents : public views::SimpleMenuModel, AddItemWithStringId(TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD); AddItemWithStringId(TabStripModel::CommandDuplicate, IDS_TAB_CXMENU_DUPLICATE); + AddCheckItemWithStringId(TabStripModel::CommandTogglePinned, + IDS_TAB_CXMENU_PIN_TAB); AddSeparator(); AddItemWithStringId(TabStripModel::CommandCloseTab, IDS_TAB_CXMENU_CLOSETAB); @@ -94,10 +96,12 @@ class Tab::TabContextMenuContents : public views::SimpleMenuModel, IDS_TAB_CXMENU_CLOSETABSTORIGHT); AddItemWithStringId(TabStripModel::CommandCloseTabsOpenedBy, IDS_TAB_CXMENU_CLOSETABSOPENEDBY); - AddItemWithStringId(TabStripModel::CommandRestoreTab, IDS_RESTORE_TAB); AddSeparator(); - AddCheckItemWithStringId(TabStripModel::CommandTogglePinned, - IDS_TAB_CXMENU_PIN_TAB); + AddItemWithStringId(TabStripModel::CommandRestoreTab, IDS_RESTORE_TAB); +#if defined(OS_WIN) + AddItemWithStringId(TabStripModel::CommandBookmarkAllTabs, + IDS_TAB_CXMENU_BOOKMARK_ALL_TABS); +#endif menu_.reset(new views::Menu2(this)); } |