| OLD | NEW |
| 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/app/chrome_dll_resource.h" | 8 #include "chrome/app/chrome_dll_resource.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_utils.h" | 9 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 10 #include "chrome/browser/cocoa/browser_window_cocoa.h" | 10 #include "chrome/browser/cocoa/browser_window_cocoa.h" |
| 11 #import "chrome/browser/cocoa/browser_window_controller.h" | 11 #import "chrome/browser/cocoa/browser_window_controller.h" |
| 12 #import "chrome/browser/cocoa/bug_report_window_controller.h" |
| 12 #import "chrome/browser/cocoa/clear_browsing_data_controller.h" | 13 #import "chrome/browser/cocoa/clear_browsing_data_controller.h" |
| 13 #import "chrome/browser/cocoa/download_shelf_controller.h" | 14 #import "chrome/browser/cocoa/download_shelf_controller.h" |
| 14 #import "chrome/browser/cocoa/html_dialog_window_controller.h" | 15 #import "chrome/browser/cocoa/html_dialog_window_controller.h" |
| 15 #import "chrome/browser/cocoa/keyword_editor_cocoa_controller.h" | 16 #import "chrome/browser/cocoa/keyword_editor_cocoa_controller.h" |
| 16 #import "chrome/browser/cocoa/nsmenuitem_additions.h" | 17 #import "chrome/browser/cocoa/nsmenuitem_additions.h" |
| 17 #include "chrome/browser/cocoa/page_info_window_mac.h" | 18 #include "chrome/browser/cocoa/page_info_window_mac.h" |
| 18 #include "chrome/browser/cocoa/repost_form_warning_mac.h" | 19 #include "chrome/browser/cocoa/repost_form_warning_mac.h" |
| 19 #include "chrome/browser/cocoa/status_bubble_mac.h" | 20 #include "chrome/browser/cocoa/status_bubble_mac.h" |
| 20 #include "chrome/browser/cocoa/task_manager_mac.h" | 21 #include "chrome/browser/cocoa/task_manager_mac.h" |
| 21 #import "chrome/browser/cocoa/theme_install_bubble_view.h" | 22 #import "chrome/browser/cocoa/theme_install_bubble_view.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 bool BrowserWindowCocoa::IsDownloadShelfVisible() const { | 240 bool BrowserWindowCocoa::IsDownloadShelfVisible() const { |
| 240 return [controller_ isDownloadShelfVisible] != NO; | 241 return [controller_ isDownloadShelfVisible] != NO; |
| 241 } | 242 } |
| 242 | 243 |
| 243 DownloadShelf* BrowserWindowCocoa::GetDownloadShelf() { | 244 DownloadShelf* BrowserWindowCocoa::GetDownloadShelf() { |
| 244 DownloadShelfController* shelfController = [controller_ downloadShelf]; | 245 DownloadShelfController* shelfController = [controller_ downloadShelf]; |
| 245 return [shelfController bridge]; | 246 return [shelfController bridge]; |
| 246 } | 247 } |
| 247 | 248 |
| 248 void BrowserWindowCocoa::ShowReportBugDialog() { | 249 void BrowserWindowCocoa::ShowReportBugDialog() { |
| 249 NOTIMPLEMENTED(); | 250 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 251 if (current_tab && current_tab->controller().GetActiveEntry()) { |
| 252 BugReportWindowController* controller = |
| 253 [[BugReportWindowController alloc] |
| 254 initWithTabContents:current_tab |
| 255 profile:browser_->profile()]; |
| 256 [controller runModalDialog]; |
| 257 } |
| 250 } | 258 } |
| 251 | 259 |
| 252 void BrowserWindowCocoa::ShowClearBrowsingDataDialog() { | 260 void BrowserWindowCocoa::ShowClearBrowsingDataDialog() { |
| 253 scoped_nsobject<ClearBrowsingDataController> controller( | 261 scoped_nsobject<ClearBrowsingDataController> controller( |
| 254 [[ClearBrowsingDataController alloc] | 262 [[ClearBrowsingDataController alloc] |
| 255 initWithProfile:browser_->profile()]); | 263 initWithProfile:browser_->profile()]); |
| 256 [controller runModalDialog]; | 264 [controller runModalDialog]; |
| 257 } | 265 } |
| 258 | 266 |
| 259 void BrowserWindowCocoa::ShowImportDialog() { | 267 void BrowserWindowCocoa::ShowImportDialog() { |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 break; | 421 break; |
| 414 } | 422 } |
| 415 } | 423 } |
| 416 | 424 |
| 417 void BrowserWindowCocoa::DestroyBrowser() { | 425 void BrowserWindowCocoa::DestroyBrowser() { |
| 418 [controller_ destroyBrowser]; | 426 [controller_ destroyBrowser]; |
| 419 | 427 |
| 420 // at this point the controller is dead (autoreleased), so | 428 // at this point the controller is dead (autoreleased), so |
| 421 // make sure we don't try to reference it any more. | 429 // make sure we don't try to reference it any more. |
| 422 } | 430 } |
| OLD | NEW |