| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/simple_message_box.h" | 5 #include "chrome/browser/ui/simple_message_box.h" | 
| 6 | 6 | 
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> | 
| 8 | 8 | 
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" | 
| 10 #include "chrome/browser/ui/simple_message_box_internal.h" | 10 #include "chrome/browser/ui/simple_message_box_internal.h" | 
| 11 #include "chrome/grit/generated_resources.h" | 11 #include "chrome/grit/generated_resources.h" | 
| 12 #include "components/startup_metric_utils/startup_metric_utils.h" | 12 #include "components/startup_metric_utils/browser/startup_metric_utils.h" | 
| 13 #include "ui/base/l10n/l10n_util_mac.h" | 13 #include "ui/base/l10n/l10n_util_mac.h" | 
| 14 | 14 | 
| 15 namespace chrome { | 15 namespace chrome { | 
| 16 | 16 | 
| 17 MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, | 17 MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, | 
| 18                                 const base::string16& title, | 18                                 const base::string16& title, | 
| 19                                 const base::string16& message, | 19                                 const base::string16& message, | 
| 20                                 MessageBoxType type) { | 20                                 MessageBoxType type) { | 
| 21   if (type == MESSAGE_BOX_TYPE_OK_CANCEL) | 21   if (type == MESSAGE_BOX_TYPE_OK_CANCEL) | 
| 22     NOTIMPLEMENTED(); | 22     NOTIMPLEMENTED(); | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 38         l10n_util::GetNSString(IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL)]; | 38         l10n_util::GetNSString(IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL)]; | 
| 39   } else { | 39   } else { | 
| 40     [alert addButtonWithTitle:l10n_util::GetNSString(IDS_OK)]; | 40     [alert addButtonWithTitle:l10n_util::GetNSString(IDS_OK)]; | 
| 41   } | 41   } | 
| 42   NSInteger result = [alert runModal]; | 42   NSInteger result = [alert runModal]; | 
| 43   return (result == NSAlertSecondButtonReturn) ? | 43   return (result == NSAlertSecondButtonReturn) ? | 
| 44       MESSAGE_BOX_RESULT_NO : MESSAGE_BOX_RESULT_YES; | 44       MESSAGE_BOX_RESULT_NO : MESSAGE_BOX_RESULT_YES; | 
| 45 } | 45 } | 
| 46 | 46 | 
| 47 }  // namespace chrome | 47 }  // namespace chrome | 
| OLD | NEW | 
|---|