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

Side by Side Diff: chrome/browser/cocoa/browser_window_cocoa.mm

Issue 115740: Move download shelf from per-tab to per-window (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 6 months 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
« no previous file with comments | « chrome/browser/cocoa/browser_window_cocoa.h ('k') | chrome/browser/download/download_file.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "base/gfx/rect.h" 5 #include "base/gfx/rect.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/sys_string_conversions.h" 7 #include "base/sys_string_conversions.h"
8 #include "chrome/browser/bookmarks/bookmark_utils.h" 8 #include "chrome/browser/bookmarks/bookmark_utils.h"
9 #include "chrome/browser/cocoa/browser_window_cocoa.h" 9 #include "chrome/browser/cocoa/browser_window_cocoa.h"
10 #import "chrome/browser/cocoa/browser_window_controller.h" 10 #import "chrome/browser/cocoa/browser_window_controller.h"
11 #import "chrome/browser/cocoa/clear_browsing_data_controller.h" 11 #import "chrome/browser/cocoa/clear_browsing_data_controller.h"
12 #include "chrome/browser/browser.h" 12 #include "chrome/browser/browser.h"
13 #include "chrome/browser/download/download_shelf.h"
13 #include "chrome/common/notification_service.h" 14 #include "chrome/common/notification_service.h"
14 #include "chrome/common/pref_names.h" 15 #include "chrome/common/pref_names.h"
15 #include "chrome/common/pref_service.h" 16 #include "chrome/common/pref_service.h"
17 #include "chrome/common/temp_scaffolding_stubs.h"
16 #include "chrome/browser/profile.h" 18 #include "chrome/browser/profile.h"
17 19
18 BrowserWindowCocoa::BrowserWindowCocoa(Browser* browser, 20 BrowserWindowCocoa::BrowserWindowCocoa(Browser* browser,
19 BrowserWindowController* controller, 21 BrowserWindowController* controller,
20 NSWindow* window) 22 NSWindow* window)
21 : window_(window), browser_(browser), controller_(controller) { 23 : window_(window),
24 browser_(browser),
25 controller_(controller),
26 download_shelf_() {
22 // This pref applies to all windows, so all must watch for it. 27 // This pref applies to all windows, so all must watch for it.
23 registrar_.Add(this, NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, 28 registrar_.Add(this, NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED,
24 NotificationService::AllSources()); 29 NotificationService::AllSources());
25 } 30 }
26 31
27 BrowserWindowCocoa::~BrowserWindowCocoa() { 32 BrowserWindowCocoa::~BrowserWindowCocoa() {
28 } 33 }
29 34
30 void BrowserWindowCocoa::Show() { 35 void BrowserWindowCocoa::Show() {
31 [window_ makeKeyAndOrderFront:controller_]; 36 [window_ makeKeyAndOrderFront:controller_];
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 180
176 void BrowserWindowCocoa::ShowBookmarkManager() { 181 void BrowserWindowCocoa::ShowBookmarkManager() {
177 NOTIMPLEMENTED(); 182 NOTIMPLEMENTED();
178 } 183 }
179 184
180 void BrowserWindowCocoa::ShowBookmarkBubble(const GURL& url, 185 void BrowserWindowCocoa::ShowBookmarkBubble(const GURL& url,
181 bool already_bookmarked) { 186 bool already_bookmarked) {
182 NOTIMPLEMENTED(); 187 NOTIMPLEMENTED();
183 } 188 }
184 189
190 bool BrowserWindowCocoa::IsDownloadShelfVisible() const {
191 return download_shelf_ != NULL && download_shelf_->IsShowing();
192 }
193
194 DownloadShelf* BrowserWindowCocoa::GetDownloadShelf() {
195 NOTIMPLEMENTED();
196 if (!download_shelf_.get()) {
197 download_shelf_.reset(new DownloadShelfMac(browser_));
198 }
199 return download_shelf_.get();
200 }
201
185 void BrowserWindowCocoa::ShowReportBugDialog() { 202 void BrowserWindowCocoa::ShowReportBugDialog() {
186 NOTIMPLEMENTED(); 203 NOTIMPLEMENTED();
187 } 204 }
188 205
189 void BrowserWindowCocoa::ShowClearBrowsingDataDialog() { 206 void BrowserWindowCocoa::ShowClearBrowsingDataDialog() {
190 scoped_nsobject<ClearBrowsingDataController> controller( 207 scoped_nsobject<ClearBrowsingDataController> controller(
191 [[ClearBrowsingDataController alloc] 208 [[ClearBrowsingDataController alloc]
192 initWithProfile:browser_->profile()]); 209 initWithProfile:browser_->profile()]);
193 [controller runModalDialog]; 210 [controller runModalDialog];
194 } 211 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 break; 263 break;
247 } 264 }
248 } 265 }
249 266
250 void BrowserWindowCocoa::DestroyBrowser() { 267 void BrowserWindowCocoa::DestroyBrowser() {
251 [controller_ destroyBrowser]; 268 [controller_ destroyBrowser];
252 269
253 // at this point the controller is dead (autoreleased), so 270 // at this point the controller is dead (autoreleased), so
254 // make sure we don't try to reference it any more. 271 // make sure we don't try to reference it any more.
255 } 272 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/browser_window_cocoa.h ('k') | chrome/browser/download/download_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698