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

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: 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 3152 matching lines...) Expand 10 before | Expand all | Expand 10 after
3163 } 3163 }
3164 3164
3165 bool Browser::CanBookmarkAllTabs() const { 3165 bool Browser::CanBookmarkAllTabs() const {
3166 BookmarkModel* model = profile()->GetBookmarkModel(); 3166 BookmarkModel* model = profile()->GetBookmarkModel();
3167 return (model && model->IsLoaded()) && 3167 return (model && model->IsLoaded()) &&
3168 tab_count() > 1 && 3168 tab_count() > 1 &&
3169 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); 3169 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled);
3170 } 3170 }
3171 3171
3172 void Browser::BookmarkAllTabs() { 3172 void Browser::BookmarkAllTabs() {
3173 #if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
3174 BookmarkEditor::ShowBookmarkAllTabsDialog(profile_);
3175 #else
3173 BookmarkModel* model = profile()->GetBookmarkModel(); 3176 BookmarkModel* model = profile()->GetBookmarkModel();
3174 DCHECK(model && model->IsLoaded()); 3177 DCHECK(model && model->IsLoaded());
3175 3178
3176 BookmarkEditor::EditDetails details = 3179 BookmarkEditor::EditDetails details =
3177 BookmarkEditor::EditDetails::AddFolder(model->GetParentForNewNodes()); 3180 BookmarkEditor::EditDetails::AddFolder(model->GetParentForNewNodes());
3178 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls)); 3181 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls));
3179 DCHECK(!details.urls.empty()); 3182 DCHECK(!details.urls.empty());
3180 3183
3181 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, details, 3184 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, details,
3182 BookmarkEditor::SHOW_TREE); 3185 BookmarkEditor::SHOW_TREE);
3186 #endif
3183 } 3187 }
3184 3188
3185 bool Browser::CanCloseTab() const { 3189 bool Browser::CanCloseTab() const {
3186 TabCloseableStateWatcher* watcher = 3190 TabCloseableStateWatcher* watcher =
3187 g_browser_process->tab_closeable_state_watcher(); 3191 g_browser_process->tab_closeable_state_watcher();
3188 return !watcher || watcher->CanCloseTab(this); 3192 return !watcher || watcher->CanCloseTab(this);
3189 } 3193 }
3190 3194
3191 bool Browser::LargeIconsPermitted() const { 3195 bool Browser::LargeIconsPermitted() const {
3192 // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because 3196 // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because
(...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after
5494 } 5498 }
5495 5499
5496 void Browser::UpdateFullscreenExitBubbleContent() { 5500 void Browser::UpdateFullscreenExitBubbleContent() {
5497 GURL url; 5501 GURL url;
5498 if (fullscreened_tab_) 5502 if (fullscreened_tab_)
5499 url = fullscreened_tab_->tab_contents()->GetURL(); 5503 url = fullscreened_tab_->tab_contents()->GetURL();
5500 5504
5501 window_->UpdateFullscreenExitBubbleContent( 5505 window_->UpdateFullscreenExitBubbleContent(
5502 url, GetFullscreenExitBubbleType()); 5506 url, GetFullscreenExitBubbleType());
5503 } 5507 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698