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 2864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2875 BookmarkModel* model = profile()->GetBookmarkModel(); | 2875 BookmarkModel* model = profile()->GetBookmarkModel(); |
2876 return (model && model->IsLoaded()) && | 2876 return (model && model->IsLoaded()) && |
2877 tab_count() > 1 && | 2877 tab_count() > 1 && |
2878 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); | 2878 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); |
2879 } | 2879 } |
2880 | 2880 |
2881 void Browser::BookmarkAllTabs() { | 2881 void Browser::BookmarkAllTabs() { |
2882 BookmarkModel* model = profile()->GetBookmarkModel(); | 2882 BookmarkModel* model = profile()->GetBookmarkModel(); |
2883 DCHECK(model && model->IsLoaded()); | 2883 DCHECK(model && model->IsLoaded()); |
2884 | 2884 |
2885 BookmarkEditor::EditDetails details; | 2885 BookmarkEditor::EditDetails details = |
2886 details.type = BookmarkEditor::EditDetails::NEW_FOLDER; | 2886 BookmarkEditor::EditDetails::AddFolder(model->GetParentForNewNodes()); |
2887 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls)); | 2887 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls)); |
2888 DCHECK(!details.urls.empty()); | 2888 DCHECK(!details.urls.empty()); |
2889 | 2889 |
2890 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, | 2890 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, details, |
2891 model->GetParentForNewNodes(), details, | |
2892 BookmarkEditor::SHOW_TREE); | 2891 BookmarkEditor::SHOW_TREE); |
2893 } | 2892 } |
2894 | 2893 |
2895 bool Browser::CanCloseTab() const { | 2894 bool Browser::CanCloseTab() const { |
2896 TabCloseableStateWatcher* watcher = | 2895 TabCloseableStateWatcher* watcher = |
2897 g_browser_process->tab_closeable_state_watcher(); | 2896 g_browser_process->tab_closeable_state_watcher(); |
2898 return !watcher || watcher->CanCloseTab(this); | 2897 return !watcher || watcher->CanCloseTab(this); |
2899 } | 2898 } |
2900 | 2899 |
2901 void Browser::ToggleUseVerticalTabs() { | 2900 void Browser::ToggleUseVerticalTabs() { |
(...skipping 1982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4884 } | 4883 } |
4885 | 4884 |
4886 void Browser::ShowSyncSetup() { | 4885 void Browser::ShowSyncSetup() { |
4887 ProfileSyncService* service = | 4886 ProfileSyncService* service = |
4888 profile()->GetOriginalProfile()->GetProfileSyncService(); | 4887 profile()->GetOriginalProfile()->GetProfileSyncService(); |
4889 if (service->HasSyncSetupCompleted()) | 4888 if (service->HasSyncSetupCompleted()) |
4890 ShowOptionsTab(chrome::kSyncSetupSubPage); | 4889 ShowOptionsTab(chrome::kSyncSetupSubPage); |
4891 else | 4890 else |
4892 service->ShowLoginDialog(); | 4891 service->ShowLoginDialog(); |
4893 } | 4892 } |
OLD | NEW |