OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 2856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2867 BookmarkModel* model = profile()->GetBookmarkModel(); | 2867 BookmarkModel* model = profile()->GetBookmarkModel(); |
2868 return (model && model->IsLoaded()) && | 2868 return (model && model->IsLoaded()) && |
2869 tab_count() > 1 && | 2869 tab_count() > 1 && |
2870 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); | 2870 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); |
2871 } | 2871 } |
2872 | 2872 |
2873 void Browser::BookmarkAllTabs() { | 2873 void Browser::BookmarkAllTabs() { |
2874 BookmarkModel* model = profile()->GetBookmarkModel(); | 2874 BookmarkModel* model = profile()->GetBookmarkModel(); |
2875 DCHECK(model && model->IsLoaded()); | 2875 DCHECK(model && model->IsLoaded()); |
2876 | 2876 |
2877 BookmarkEditor::EditDetails details; | 2877 BookmarkEditor::EditDetails details = |
2878 details.type = BookmarkEditor::EditDetails::NEW_FOLDER; | 2878 BookmarkEditor::EditDetails::AddFolder(model->GetParentForNewNodes()); |
2879 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls)); | 2879 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls)); |
2880 DCHECK(!details.urls.empty()); | 2880 DCHECK(!details.urls.empty()); |
2881 | 2881 |
2882 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, | 2882 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, details, |
2883 model->GetParentForNewNodes(), details, | |
2884 BookmarkEditor::SHOW_TREE); | 2883 BookmarkEditor::SHOW_TREE); |
2885 } | 2884 } |
2886 | 2885 |
2887 bool Browser::CanCloseTab() const { | 2886 bool Browser::CanCloseTab() const { |
2888 TabCloseableStateWatcher* watcher = | 2887 TabCloseableStateWatcher* watcher = |
2889 g_browser_process->tab_closeable_state_watcher(); | 2888 g_browser_process->tab_closeable_state_watcher(); |
2890 return !watcher || watcher->CanCloseTab(this); | 2889 return !watcher || watcher->CanCloseTab(this); |
2891 } | 2890 } |
2892 | 2891 |
2893 void Browser::ToggleUseVerticalTabs() { | 2892 void Browser::ToggleUseVerticalTabs() { |
(...skipping 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4874 } | 4873 } |
4875 | 4874 |
4876 void Browser::ShowSyncSetup() { | 4875 void Browser::ShowSyncSetup() { |
4877 ProfileSyncService* service = | 4876 ProfileSyncService* service = |
4878 profile()->GetOriginalProfile()->GetProfileSyncService(); | 4877 profile()->GetOriginalProfile()->GetProfileSyncService(); |
4879 if (service->HasSyncSetupCompleted()) | 4878 if (service->HasSyncSetupCompleted()) |
4880 ShowOptionsTab(chrome::kSyncSetupSubPage); | 4879 ShowOptionsTab(chrome::kSyncSetupSubPage); |
4881 else | 4880 else |
4882 service->ShowLoginDialog(); | 4881 service->ShowLoginDialog(); |
4883 } | 4882 } |
OLD | NEW |