Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 8497008: Implement Bookmark All Tabs Dialog with WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 3160 matching lines...) Expand 10 before | Expand all | Expand 10 after
3171 } 3171 }
3172 3172
3173 bool Browser::CanBookmarkAllTabs() const { 3173 bool Browser::CanBookmarkAllTabs() const {
3174 BookmarkModel* model = profile()->GetBookmarkModel(); 3174 BookmarkModel* model = profile()->GetBookmarkModel();
3175 return (model && model->IsLoaded()) && 3175 return (model && model->IsLoaded()) &&
3176 tab_count() > 1 && 3176 tab_count() > 1 &&
3177 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); 3177 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled);
3178 } 3178 }
3179 3179
3180 void Browser::BookmarkAllTabs() { 3180 void Browser::BookmarkAllTabs() {
3181 BookmarkModel* model = profile()->GetBookmarkModel(); 3181 BookmarkEditor::ShowBookmarkAllTabsDialog(this);
3182 DCHECK(model && model->IsLoaded());
3183
3184 BookmarkEditor::EditDetails details =
3185 BookmarkEditor::EditDetails::AddFolder(model->GetParentForNewNodes(), -1);
3186 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls));
3187 DCHECK(!details.urls.empty());
3188
3189 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, details,
3190 BookmarkEditor::SHOW_TREE);
3191 } 3182 }
3192 3183
3193 bool Browser::CanCloseTab() const { 3184 bool Browser::CanCloseTab() const {
3194 TabCloseableStateWatcher* watcher = 3185 TabCloseableStateWatcher* watcher =
3195 g_browser_process->tab_closeable_state_watcher(); 3186 g_browser_process->tab_closeable_state_watcher();
3196 return !watcher || watcher->CanCloseTab(this); 3187 return !watcher || watcher->CanCloseTab(this);
3197 } 3188 }
3198 3189
3199 bool Browser::LargeIconsPermitted() const { 3190 bool Browser::LargeIconsPermitted() const {
3200 // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because 3191 // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because
(...skipping 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after
5508 } 5499 }
5509 5500
5510 void Browser::UpdateFullscreenExitBubbleContent() { 5501 void Browser::UpdateFullscreenExitBubbleContent() {
5511 GURL url; 5502 GURL url;
5512 if (fullscreened_tab_) 5503 if (fullscreened_tab_)
5513 url = fullscreened_tab_->tab_contents()->GetURL(); 5504 url = fullscreened_tab_->tab_contents()->GetURL();
5514 5505
5515 window_->UpdateFullscreenExitBubbleContent( 5506 window_->UpdateFullscreenExitBubbleContent(
5516 url, GetFullscreenExitBubbleType()); 5507 url, GetFullscreenExitBubbleType());
5517 } 5508 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698