| 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 16 matching lines...) Expand all Loading... |
| 27 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" | 27 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" |
| 28 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" | 28 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
| 29 #import "chrome/browser/ui/cocoa/html_dialog_window_controller.h" | 29 #import "chrome/browser/ui/cocoa/html_dialog_window_controller.h" |
| 30 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 30 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
| 31 #import "chrome/browser/ui/cocoa/nsmenuitem_additions.h" | 31 #import "chrome/browser/ui/cocoa/nsmenuitem_additions.h" |
| 32 #include "chrome/browser/ui/cocoa/page_info_window.h" | 32 #include "chrome/browser/ui/cocoa/page_info_window.h" |
| 33 #include "chrome/browser/ui/cocoa/repost_form_warning_mac.h" | 33 #include "chrome/browser/ui/cocoa/repost_form_warning_mac.h" |
| 34 #include "chrome/browser/ui/cocoa/restart_browser.h" | 34 #include "chrome/browser/ui/cocoa/restart_browser.h" |
| 35 #include "chrome/browser/ui/cocoa/status_bubble_mac.h" | 35 #include "chrome/browser/ui/cocoa/status_bubble_mac.h" |
| 36 #include "chrome/browser/ui/cocoa/task_manager_mac.h" | 36 #include "chrome/browser/ui/cocoa/task_manager_mac.h" |
| 37 #import "chrome/browser/ui/cocoa/theme_install_bubble_view.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/tab_contents/tab_contents_wrapper.h" | 38 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 40 #include "chrome/browser/ui/webui/task_manager_dialog.h" | 39 #include "chrome/browser/ui/webui/task_manager_dialog.h" |
| 41 #include "chrome/common/chrome_notification_types.h" | 40 #include "chrome/common/chrome_notification_types.h" |
| 42 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
| 43 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
| 44 #include "content/browser/tab_contents/tab_contents.h" | 43 #include "content/browser/tab_contents/tab_contents.h" |
| 45 #include "content/public/browser/notification_source.h" | 44 #include "content/public/browser/notification_source.h" |
| 46 #include "content/public/browser/native_web_keyboard_event.h" | 45 #include "content/public/browser/native_web_keyboard_event.h" |
| 47 #include "content/public/browser/notification_details.h" | 46 #include "content/public/browser/notification_details.h" |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 TabContents* tab_contents) { | 418 TabContents* tab_contents) { |
| 420 RepostFormWarningMac::Create(GetNativeHandle(), tab_contents); | 419 RepostFormWarningMac::Create(GetNativeHandle(), tab_contents); |
| 421 } | 420 } |
| 422 | 421 |
| 423 void BrowserWindowCocoa::ShowCollectedCookiesDialog( | 422 void BrowserWindowCocoa::ShowCollectedCookiesDialog( |
| 424 TabContentsWrapper* wrapper) { | 423 TabContentsWrapper* wrapper) { |
| 425 // Deletes itself on close. | 424 // Deletes itself on close. |
| 426 new CollectedCookiesMac(GetNativeHandle(), wrapper); | 425 new CollectedCookiesMac(GetNativeHandle(), wrapper); |
| 427 } | 426 } |
| 428 | 427 |
| 429 void BrowserWindowCocoa::ShowThemeInstallBubble() { | |
| 430 ThemeInstallBubbleView::Show(window()); | |
| 431 } | |
| 432 | |
| 433 // We allow closing the window here since the real quit decision on Mac is made | 428 // We allow closing the window here since the real quit decision on Mac is made |
| 434 // in [AppController quit:]. | 429 // in [AppController quit:]. |
| 435 void BrowserWindowCocoa::ConfirmBrowserCloseWithPendingDownloads() { | 430 void BrowserWindowCocoa::ConfirmBrowserCloseWithPendingDownloads() { |
| 436 // Call InProgressDownloadResponse asynchronously to avoid a crash when the | 431 // Call InProgressDownloadResponse asynchronously to avoid a crash when the |
| 437 // browser window is closed here (http://crbug.com/44454). | 432 // browser window is closed here (http://crbug.com/44454). |
| 438 MessageLoop::current()->PostTask(FROM_HERE, | 433 MessageLoop::current()->PostTask(FROM_HERE, |
| 439 base::Bind(&Browser::InProgressDownloadResponse, | 434 base::Bind(&Browser::InProgressDownloadResponse, |
| 440 confirm_close_factory_.GetWeakPtr(), true)); | 435 confirm_close_factory_.GetWeakPtr(), true)); |
| 441 } | 436 } |
| 442 | 437 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 point.y = NSMaxY(bounds) - rect.bottom(); | 606 point.y = NSMaxY(bounds) - rect.bottom(); |
| 612 point = [view convertPoint:point toView:nil]; | 607 point = [view convertPoint:point toView:nil]; |
| 613 point = [[view window] convertBaseToScreen:point]; | 608 point = [[view window] convertBaseToScreen:point]; |
| 614 | 609 |
| 615 // |menu| will automatically release itself on close. | 610 // |menu| will automatically release itself on close. |
| 616 AvatarMenuBubbleController* menu = | 611 AvatarMenuBubbleController* menu = |
| 617 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ | 612 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ |
| 618 anchoredAt:point]; | 613 anchoredAt:point]; |
| 619 [menu showWindow:nil]; | 614 [menu showWindow:nil]; |
| 620 } | 615 } |
| OLD | NEW |