Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util_mac.h" | 5 #include "app/l10n_util_mac.h" |
| 6 #include "base/gfx/rect.h" | 6 #include "base/gfx/rect.h" |
| 7 #include "base/keyboard_codes.h" | 7 #include "base/keyboard_codes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| 11 #include "chrome/browser/bookmarks/bookmark_utils.h" | 11 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 12 #include "chrome/browser/browser_list.h" | 12 #include "chrome/browser/browser_list.h" |
| 13 #import "chrome/browser/cocoa/bookmark_manager_controller.h" | 13 #import "chrome/browser/cocoa/bookmark_manager_controller.h" |
| 14 #include "chrome/browser/cocoa/browser_window_cocoa.h" | 14 #include "chrome/browser/cocoa/browser_window_cocoa.h" |
|
viettrungluu
2010/02/22 00:57:40
#include first
| |
| 15 #import "chrome/browser/cocoa/browser_window_controller.h" | 15 #import "chrome/browser/cocoa/browser_window_controller.h" |
| 16 #import "chrome/browser/cocoa/bug_report_window_controller.h" | 16 #import "chrome/browser/cocoa/bug_report_window_controller.h" |
| 17 #import "chrome/browser/cocoa/chrome_browser_window.h" | |
| 17 #import "chrome/browser/cocoa/clear_browsing_data_controller.h" | 18 #import "chrome/browser/cocoa/clear_browsing_data_controller.h" |
| 18 #import "chrome/browser/cocoa/chrome_browser_window.h" | 19 #import "chrome/browser/cocoa/content_settings_dialog_controller.h" |
| 19 #import "chrome/browser/cocoa/download_shelf_controller.h" | 20 #import "chrome/browser/cocoa/download_shelf_controller.h" |
| 20 #import "chrome/browser/cocoa/html_dialog_window_controller.h" | 21 #import "chrome/browser/cocoa/html_dialog_window_controller.h" |
| 21 #import "chrome/browser/cocoa/import_settings_dialog.h" | 22 #import "chrome/browser/cocoa/import_settings_dialog.h" |
| 22 #import "chrome/browser/cocoa/keyword_editor_cocoa_controller.h" | 23 #import "chrome/browser/cocoa/keyword_editor_cocoa_controller.h" |
| 23 #import "chrome/browser/cocoa/nsmenuitem_additions.h" | 24 #import "chrome/browser/cocoa/nsmenuitem_additions.h" |
| 24 #include "chrome/browser/cocoa/page_info_window_mac.h" | 25 #include "chrome/browser/cocoa/page_info_window_mac.h" |
| 25 #include "chrome/browser/cocoa/repost_form_warning_mac.h" | 26 #include "chrome/browser/cocoa/repost_form_warning_mac.h" |
| 26 #include "chrome/browser/cocoa/status_bubble_mac.h" | 27 #include "chrome/browser/cocoa/status_bubble_mac.h" |
| 27 #include "chrome/browser/cocoa/task_manager_mac.h" | 28 #include "chrome/browser/cocoa/task_manager_mac.h" |
| 28 #import "chrome/browser/cocoa/theme_install_bubble_view.h" | 29 #import "chrome/browser/cocoa/theme_install_bubble_view.h" |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 void BrowserWindowCocoa::ShowNewProfileDialog() { | 311 void BrowserWindowCocoa::ShowNewProfileDialog() { |
| 311 NOTIMPLEMENTED(); | 312 NOTIMPLEMENTED(); |
| 312 } | 313 } |
| 313 | 314 |
| 314 void BrowserWindowCocoa::ShowRepostFormWarningDialog( | 315 void BrowserWindowCocoa::ShowRepostFormWarningDialog( |
| 315 TabContents* tab_contents) { | 316 TabContents* tab_contents) { |
| 316 new RepostFormWarningMac(GetNativeHandle(), &tab_contents->controller()); | 317 new RepostFormWarningMac(GetNativeHandle(), &tab_contents->controller()); |
| 317 } | 318 } |
| 318 | 319 |
| 319 void BrowserWindowCocoa::ShowContentSettingsWindow( | 320 void BrowserWindowCocoa::ShowContentSettingsWindow( |
| 320 ContentSettingsType content_type, | 321 ContentSettingsType settingsType, |
|
viettrungluu
2010/02/22 00:57:40
Being a C++ method, C++ naming rules apply. So |se
| |
| 321 Profile* profile) { | 322 Profile* profile) { |
| 322 NOTIMPLEMENTED(); | 323 [ContentSettingsDialogController showContentSettingsForType:settingsType |
| 324 profile:profile]; | |
| 323 } | 325 } |
| 324 | 326 |
| 325 void BrowserWindowCocoa::ShowProfileErrorDialog(int message_id) { | 327 void BrowserWindowCocoa::ShowProfileErrorDialog(int message_id) { |
| 326 scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]); | 328 scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]); |
| 327 [alert addButtonWithTitle:l10n_util::GetNSStringWithFixup(IDS_OK)]; | 329 [alert addButtonWithTitle:l10n_util::GetNSStringWithFixup(IDS_OK)]; |
| 328 [alert setMessageText:l10n_util::GetNSStringWithFixup(IDS_PRODUCT_NAME)]; | 330 [alert setMessageText:l10n_util::GetNSStringWithFixup(IDS_PRODUCT_NAME)]; |
| 329 [alert setInformativeText:l10n_util::GetNSStringWithFixup(message_id)]; | 331 [alert setInformativeText:l10n_util::GetNSStringWithFixup(message_id)]; |
| 330 [alert setAlertStyle:NSWarningAlertStyle]; | 332 [alert setAlertStyle:NSWarningAlertStyle]; |
| 331 [alert runModal]; | 333 [alert runModal]; |
| 332 } | 334 } |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 537 void BrowserWindowCocoa::DestroyBrowser() { | 539 void BrowserWindowCocoa::DestroyBrowser() { |
| 538 [controller_ destroyBrowser]; | 540 [controller_ destroyBrowser]; |
| 539 | 541 |
| 540 // at this point the controller is dead (autoreleased), so | 542 // at this point the controller is dead (autoreleased), so |
| 541 // make sure we don't try to reference it any more. | 543 // make sure we don't try to reference it any more. |
| 542 } | 544 } |
| 543 | 545 |
| 544 NSWindow* BrowserWindowCocoa::window() const { | 546 NSWindow* BrowserWindowCocoa::window() const { |
| 545 return [controller_ window]; | 547 return [controller_ window]; |
| 546 } | 548 } |
| OLD | NEW |