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 3095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3106 BookmarkModel* model = profile()->GetBookmarkModel(); | 3106 BookmarkModel* model = profile()->GetBookmarkModel(); |
3107 return (model && model->IsLoaded()) && | 3107 return (model && model->IsLoaded()) && |
3108 tab_count() > 1 && | 3108 tab_count() > 1 && |
3109 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); | 3109 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); |
3110 } | 3110 } |
3111 | 3111 |
3112 void Browser::BookmarkAllTabs() { | 3112 void Browser::BookmarkAllTabs() { |
3113 BookmarkModel* model = profile()->GetBookmarkModel(); | 3113 BookmarkModel* model = profile()->GetBookmarkModel(); |
3114 DCHECK(model && model->IsLoaded()); | 3114 DCHECK(model && model->IsLoaded()); |
3115 | 3115 |
3116 BookmarkEditor::EditDetails details = | 3116 BookmarkEditor::EditDetails details; |
3117 BookmarkEditor::EditDetails::AddFolder(model->GetParentForNewNodes()); | 3117 details.type = BookmarkEditor::EditDetails::NEW_FOLDER; |
3118 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls)); | 3118 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls)); |
3119 DCHECK(!details.urls.empty()); | 3119 DCHECK(!details.urls.empty()); |
3120 | 3120 |
3121 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, details, | 3121 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, |
| 3122 model->GetParentForNewNodes(), details, |
3122 BookmarkEditor::SHOW_TREE); | 3123 BookmarkEditor::SHOW_TREE); |
3123 } | 3124 } |
3124 | 3125 |
3125 bool Browser::CanCloseTab() const { | 3126 bool Browser::CanCloseTab() const { |
3126 TabCloseableStateWatcher* watcher = | 3127 TabCloseableStateWatcher* watcher = |
3127 g_browser_process->tab_closeable_state_watcher(); | 3128 g_browser_process->tab_closeable_state_watcher(); |
3128 return !watcher || watcher->CanCloseTab(this); | 3129 return !watcher || watcher->CanCloseTab(this); |
3129 } | 3130 } |
3130 | 3131 |
3131 void Browser::ToggleUseVerticalTabs() { | 3132 void Browser::ToggleUseVerticalTabs() { |
(...skipping 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5237 profile()->GetOriginalProfile()->GetProfileSyncService(); | 5238 profile()->GetOriginalProfile()->GetProfileSyncService(); |
5238 if (service->HasSyncSetupCompleted()) | 5239 if (service->HasSyncSetupCompleted()) |
5239 ShowOptionsTab(chrome::kSyncSetupSubPage); | 5240 ShowOptionsTab(chrome::kSyncSetupSubPage); |
5240 else | 5241 else |
5241 service->ShowLoginDialog(); | 5242 service->ShowLoginDialog(); |
5242 } | 5243 } |
5243 | 5244 |
5244 void Browser::ToggleSpeechInput() { | 5245 void Browser::ToggleSpeechInput() { |
5245 GetSelectedTabContentsWrapper()->render_view_host()->ToggleSpeechInput(); | 5246 GetSelectedTabContentsWrapper()->render_view_host()->ToggleSpeechInput(); |
5246 } | 5247 } |
OLD | NEW |