| OLD | NEW |
| 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/cocoa/browser_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 24 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 25 #import "chrome/browser/ui/cocoa/browser_window_utils.h" | 25 #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
| 26 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" | 26 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" |
| 27 #import "chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h" | 27 #import "chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h" |
| 28 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" | 28 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" |
| 29 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" | 29 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
| 30 #import "chrome/browser/ui/cocoa/html_dialog_window_controller.h" | 30 #import "chrome/browser/ui/cocoa/html_dialog_window_controller.h" |
| 31 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 31 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
| 32 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 32 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
| 33 #import "chrome/browser/ui/cocoa/nsmenuitem_additions.h" | 33 #import "chrome/browser/ui/cocoa/nsmenuitem_additions.h" |
| 34 #include "chrome/browser/ui/cocoa/repost_form_warning_mac.h" | |
| 35 #include "chrome/browser/ui/cocoa/restart_browser.h" | 34 #include "chrome/browser/ui/cocoa/restart_browser.h" |
| 36 #include "chrome/browser/ui/cocoa/status_bubble_mac.h" | 35 #include "chrome/browser/ui/cocoa/status_bubble_mac.h" |
| 37 #include "chrome/browser/ui/cocoa/task_manager_mac.h" | 36 #include "chrome/browser/ui/cocoa/task_manager_mac.h" |
| 38 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 37 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 39 #include "chrome/browser/ui/page_info_bubble.h" | 38 #include "chrome/browser/ui/page_info_bubble.h" |
| 40 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 39 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 41 #include "chrome/browser/ui/webui/chrome_web_ui.h" | 40 #include "chrome/browser/ui/webui/chrome_web_ui.h" |
| 42 #include "chrome/browser/ui/webui/task_manager_dialog.h" | 41 #include "chrome/browser/ui/webui/task_manager_dialog.h" |
| 43 #include "chrome/common/chrome_notification_types.h" | 42 #include "chrome/common/chrome_notification_types.h" |
| 44 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 423 |
| 425 bool BrowserWindowCocoa::IsDownloadShelfVisible() const { | 424 bool BrowserWindowCocoa::IsDownloadShelfVisible() const { |
| 426 return [controller_ isDownloadShelfVisible] != NO; | 425 return [controller_ isDownloadShelfVisible] != NO; |
| 427 } | 426 } |
| 428 | 427 |
| 429 DownloadShelf* BrowserWindowCocoa::GetDownloadShelf() { | 428 DownloadShelf* BrowserWindowCocoa::GetDownloadShelf() { |
| 430 DownloadShelfController* shelfController = [controller_ downloadShelf]; | 429 DownloadShelfController* shelfController = [controller_ downloadShelf]; |
| 431 return [shelfController bridge]; | 430 return [shelfController bridge]; |
| 432 } | 431 } |
| 433 | 432 |
| 434 void BrowserWindowCocoa::ShowRepostFormWarningDialog( | |
| 435 TabContents* tab_contents) { | |
| 436 RepostFormWarningMac::Create(GetNativeHandle(), tab_contents); | |
| 437 } | |
| 438 | |
| 439 void BrowserWindowCocoa::ShowCollectedCookiesDialog( | 433 void BrowserWindowCocoa::ShowCollectedCookiesDialog( |
| 440 TabContentsWrapper* wrapper) { | 434 TabContentsWrapper* wrapper) { |
| 441 // Deletes itself on close. | 435 // Deletes itself on close. |
| 442 new CollectedCookiesMac(GetNativeHandle(), wrapper); | 436 new CollectedCookiesMac(GetNativeHandle(), wrapper); |
| 443 } | 437 } |
| 444 | 438 |
| 445 // We allow closing the window here since the real quit decision on Mac is made | 439 // We allow closing the window here since the real quit decision on Mac is made |
| 446 // in [AppController quit:]. | 440 // in [AppController quit:]. |
| 447 void BrowserWindowCocoa::ConfirmBrowserCloseWithPendingDownloads() { | 441 void BrowserWindowCocoa::ConfirmBrowserCloseWithPendingDownloads() { |
| 448 // Call InProgressDownloadResponse asynchronously to avoid a crash when the | 442 // Call InProgressDownloadResponse asynchronously to avoid a crash when the |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 AvatarMenuBubbleController* menu = | 622 AvatarMenuBubbleController* menu = |
| 629 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ | 623 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ |
| 630 anchoredAt:point]; | 624 anchoredAt:point]; |
| 631 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; | 625 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; |
| 632 [menu showWindow:nil]; | 626 [menu showWindow:nil]; |
| 633 } | 627 } |
| 634 | 628 |
| 635 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { | 629 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { |
| 636 [[controller_ avatarButtonController] showAvatarBubble]; | 630 [[controller_ avatarButtonController] showAvatarBubble]; |
| 637 } | 631 } |
| OLD | NEW |