| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_install_dialog.h" | 9 #include "chrome/browser/extensions/extension_install_dialog.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 permission_box_->SetBounds(permission_box_->x(), permission_box_->y(), | 268 permission_box_->SetBounds(permission_box_->x(), permission_box_->y(), |
| 269 right_column_width_, permission_box_height); | 269 right_column_width_, permission_box_height); |
| 270 } | 270 } |
| 271 | 271 |
| 272 std::wstring ExtensionInstallDialogView::GetDialogButtonLabel( | 272 std::wstring ExtensionInstallDialogView::GetDialogButtonLabel( |
| 273 MessageBoxFlags::DialogButton button) const { | 273 MessageBoxFlags::DialogButton button) const { |
| 274 switch (button) { | 274 switch (button) { |
| 275 case MessageBoxFlags::DIALOGBUTTON_OK: | 275 case MessageBoxFlags::DIALOGBUTTON_OK: |
| 276 return UTF16ToWide( | 276 return UTF16ToWide( |
| 277 l10n_util::GetStringUTF16(ExtensionInstallUI::kButtonIds[type_])); | 277 l10n_util::GetStringUTF16(ExtensionInstallUI::kButtonIds[type_])); |
| 278 case MessageBoxFlags::DIALOGBUTTON_CANCEL: | 278 case MessageBoxFlags::DIALOGBUTTON_CANCEL: { |
| 279 return UTF16ToWide(l10n_util::GetStringUTF16(IDS_CANCEL)); | 279 int id = ExtensionInstallUI::kAbortButtonIds[type_]; |
| 280 return UTF16ToWide(l10n_util::GetStringUTF16(id > 0 ? id : IDS_CANCEL)); |
| 281 } |
| 280 default: | 282 default: |
| 281 NOTREACHED(); | 283 NOTREACHED(); |
| 282 return std::wstring(); | 284 return std::wstring(); |
| 283 } | 285 } |
| 284 } | 286 } |
| 285 | 287 |
| 286 int ExtensionInstallDialogView::GetDefaultDialogButton() const { | 288 int ExtensionInstallDialogView::GetDefaultDialogButton() const { |
| 287 return MessageBoxFlags::DIALOGBUTTON_CANCEL; | 289 return MessageBoxFlags::DIALOGBUTTON_CANCEL; |
| 288 } | 290 } |
| 289 | 291 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 } | 337 } |
| 336 | 338 |
| 337 ExtensionInstallDialogView* dialog = new ExtensionInstallDialogView( | 339 ExtensionInstallDialogView* dialog = new ExtensionInstallDialogView( |
| 338 delegate, extension, icon, permissions, type); | 340 delegate, extension, icon, permissions, type); |
| 339 | 341 |
| 340 views::Widget* window = browser::CreateViewsWindow( | 342 views::Widget* window = browser::CreateViewsWindow( |
| 341 browser_window->GetNativeHandle(), gfx::Rect(), dialog); | 343 browser_window->GetNativeHandle(), gfx::Rect(), dialog); |
| 342 | 344 |
| 343 window->Show(); | 345 window->Show(); |
| 344 } | 346 } |
| OLD | NEW |