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

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: resolve conflict on chrome/chrome_browser.gypi. 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 3157 matching lines...) Expand 10 before | Expand all | Expand 10 after
3168 } 3168 }
3169 3169
3170 bool Browser::CanBookmarkAllTabs() const { 3170 bool Browser::CanBookmarkAllTabs() const {
3171 BookmarkModel* model = profile()->GetBookmarkModel(); 3171 BookmarkModel* model = profile()->GetBookmarkModel();
3172 return (model && model->IsLoaded()) && 3172 return (model && model->IsLoaded()) &&
3173 tab_count() > 1 && 3173 tab_count() > 1 &&
3174 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled); 3174 profile()->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled);
3175 } 3175 }
3176 3176
3177 void Browser::BookmarkAllTabs() { 3177 void Browser::BookmarkAllTabs() {
3178 BookmarkModel* model = profile()->GetBookmarkModel(); 3178 BookmarkEditor::ShowBookmarkAllTabsDialog(this);
3179 DCHECK(model && model->IsLoaded());
3180
3181 BookmarkEditor::EditDetails details =
3182 BookmarkEditor::EditDetails::AddFolder(model->GetParentForNewNodes(), -1);
3183 bookmark_utils::GetURLsForOpenTabs(this, &(details.urls));
3184 DCHECK(!details.urls.empty());
3185
3186 BookmarkEditor::Show(window()->GetNativeHandle(), profile_, details,
3187 BookmarkEditor::SHOW_TREE);
3188 } 3179 }
3189 3180
3190 bool Browser::CanCloseTab() const { 3181 bool Browser::CanCloseTab() const {
3191 TabCloseableStateWatcher* watcher = 3182 TabCloseableStateWatcher* watcher =
3192 g_browser_process->tab_closeable_state_watcher(); 3183 g_browser_process->tab_closeable_state_watcher();
3193 return !watcher || watcher->CanCloseTab(this); 3184 return !watcher || watcher->CanCloseTab(this);
3194 } 3185 }
3195 3186
3196 bool Browser::LargeIconsPermitted() const { 3187 bool Browser::LargeIconsPermitted() const {
3197 // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because 3188 // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because
(...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after
5507 } 5498 }
5508 5499
5509 void Browser::UpdateFullscreenExitBubbleContent() { 5500 void Browser::UpdateFullscreenExitBubbleContent() {
5510 GURL url; 5501 GURL url;
5511 if (fullscreened_tab_) 5502 if (fullscreened_tab_)
5512 url = fullscreened_tab_->tab_contents()->GetURL(); 5503 url = fullscreened_tab_->tab_contents()->GetURL();
5513 5504
5514 window_->UpdateFullscreenExitBubbleContent( 5505 window_->UpdateFullscreenExitBubbleContent(
5515 url, GetFullscreenExitBubbleType()); 5506 url, GetFullscreenExitBubbleType());
5516 } 5507 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698