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 3166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3177 } | 3177 } |
3178 | 3178 |
3179 bool Browser::CanBookmarkAllTabs() const { | 3179 bool Browser::CanBookmarkAllTabs() const { |
3180 BookmarkModel* model = profile()->GetBookmarkModel(); | 3180 BookmarkModel* model = profile()->GetBookmarkModel(); |
3181 return (model && model->IsLoaded()) && | 3181 return (model && model->IsLoaded()) && |
3182 tab_count() > 1 && | 3182 tab_count() > 1 && |
3183 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); | 3183 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); |
3184 } | 3184 } |
3185 | 3185 |
3186 void Browser::BookmarkAllTabs() { | 3186 void Browser::BookmarkAllTabs() { |
3187 BookmarkModel* model = profile()->GetBookmarkModel(); | 3187 BookmarkEditor::ShowBookmarkAllTabsDialog(this); |
3188 DCHECK(model && model->IsLoaded()); | |
3189 | |
3190 BookmarkEditor::EditDetails details = | |
3191 BookmarkEditor::EditDetails::AddFolder(model->GetParentForNewNodes(), -1); | |
3192 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls)); | |
3193 DCHECK(!details.urls.empty()); | |
3194 | |
3195 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, details, | |
3196 BookmarkEditor::SHOW_TREE); | |
3197 } | 3188 } |
3198 | 3189 |
3199 bool Browser::CanCloseTab() const { | 3190 bool Browser::CanCloseTab() const { |
3200 TabCloseableStateWatcher* watcher = | 3191 TabCloseableStateWatcher* watcher = |
3201 g_browser_process->tab_closeable_state_watcher(); | 3192 g_browser_process->tab_closeable_state_watcher(); |
3202 return !watcher || watcher->CanCloseTab(this); | 3193 return !watcher || watcher->CanCloseTab(this); |
3203 } | 3194 } |
3204 | 3195 |
3205 bool Browser::LargeIconsPermitted() const { | 3196 bool Browser::LargeIconsPermitted() const { |
3206 // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because | 3197 // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because |
(...skipping 2310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5517 } | 5508 } |
5518 | 5509 |
5519 void Browser::UpdateFullscreenExitBubbleContent() { | 5510 void Browser::UpdateFullscreenExitBubbleContent() { |
5520 GURL url; | 5511 GURL url; |
5521 if (fullscreened_tab_) | 5512 if (fullscreened_tab_) |
5522 url = fullscreened_tab_->tab_contents()->GetURL(); | 5513 url = fullscreened_tab_->tab_contents()->GetURL(); |
5523 | 5514 |
5524 window_->UpdateFullscreenExitBubbleContent( | 5515 window_->UpdateFullscreenExitBubbleContent( |
5525 url, GetFullscreenExitBubbleType()); | 5516 url, GetFullscreenExitBubbleType()); |
5526 } | 5517 } |
OLD | NEW |