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 3117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3128 BookmarkModel* model = profile()->GetBookmarkModel(); | 3128 BookmarkModel* model = profile()->GetBookmarkModel(); |
3129 return (model && model->IsLoaded()) && | 3129 return (model && model->IsLoaded()) && |
3130 tab_count() > 1 && | 3130 tab_count() > 1 && |
3131 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); | 3131 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); |
3132 } | 3132 } |
3133 | 3133 |
3134 void Browser::BookmarkAllTabs() { | 3134 void Browser::BookmarkAllTabs() { |
3135 BookmarkModel* model = profile()->GetBookmarkModel(); | 3135 BookmarkModel* model = profile()->GetBookmarkModel(); |
3136 DCHECK(model && model->IsLoaded()); | 3136 DCHECK(model && model->IsLoaded()); |
3137 | 3137 |
3138 BookmarkEditor::EditDetails details; | 3138 BookmarkEditor::EditDetails details = |
3139 details.type = BookmarkEditor::EditDetails::NEW_FOLDER; | 3139 BookmarkEditor::EditDetails::AddFolder(model->GetParentForNewNodes()); |
3140 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls)); | 3140 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls)); |
3141 DCHECK(!details.urls.empty()); | 3141 DCHECK(!details.urls.empty()); |
3142 | 3142 |
3143 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, | 3143 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, details, |
3144 model->GetParentForNewNodes(), details, | |
3145 BookmarkEditor::SHOW_TREE); | 3144 BookmarkEditor::SHOW_TREE); |
3146 } | 3145 } |
3147 | 3146 |
3148 bool Browser::CanCloseTab() const { | 3147 bool Browser::CanCloseTab() const { |
3149 TabCloseableStateWatcher* watcher = | 3148 TabCloseableStateWatcher* watcher = |
3150 g_browser_process->tab_closeable_state_watcher(); | 3149 g_browser_process->tab_closeable_state_watcher(); |
3151 return !watcher || watcher->CanCloseTab(this); | 3150 return !watcher || watcher->CanCloseTab(this); |
3152 } | 3151 } |
3153 | 3152 |
3154 void Browser::ToggleUseVerticalTabs() { | 3153 void Browser::ToggleUseVerticalTabs() { |
(...skipping 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5254 profile()->GetOriginalProfile()->GetProfileSyncService(); | 5253 profile()->GetOriginalProfile()->GetProfileSyncService(); |
5255 if (service->HasSyncSetupCompleted()) | 5254 if (service->HasSyncSetupCompleted()) |
5256 ShowOptionsTab(chrome::kSyncSetupSubPage); | 5255 ShowOptionsTab(chrome::kSyncSetupSubPage); |
5257 else | 5256 else |
5258 service->ShowLoginDialog(); | 5257 service->ShowLoginDialog(); |
5259 } | 5258 } |
5260 | 5259 |
5261 void Browser::ToggleSpeechInput() { | 5260 void Browser::ToggleSpeechInput() { |
5262 GetSelectedTabContentsWrapper()->render_view_host()->ToggleSpeechInput(); | 5261 GetSelectedTabContentsWrapper()->render_view_host()->ToggleSpeechInput(); |
5263 } | 5262 } |
OLD | NEW |