| OLD | NEW |
| 1 // Copyright (c) 2011 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/confirm_bubble_model.h" | 5 #include "chrome/browser/ui/confirm_bubble_model.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "grit/generated_resources.h" | 8 #include "grit/generated_resources.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 | 10 |
| 11 #if defined(TOOLKIT_VIEWS) | |
| 12 #include "chrome/browser/ui/views/confirm_bubble_view.h" | |
| 13 #include "chrome/browser/ui/views/window.h" | |
| 14 #endif | |
| 15 | |
| 16 ConfirmBubbleModel::ConfirmBubbleModel() { | 11 ConfirmBubbleModel::ConfirmBubbleModel() { |
| 17 } | 12 } |
| 18 | 13 |
| 19 ConfirmBubbleModel::~ConfirmBubbleModel() { | 14 ConfirmBubbleModel::~ConfirmBubbleModel() { |
| 20 } | 15 } |
| 21 | 16 |
| 22 int ConfirmBubbleModel::GetButtons() const { | 17 int ConfirmBubbleModel::GetButtons() const { |
| 23 return BUTTON_OK | BUTTON_CANCEL; | 18 return BUTTON_OK | BUTTON_CANCEL; |
| 24 } | 19 } |
| 25 | 20 |
| 26 string16 ConfirmBubbleModel::GetButtonLabel(BubbleButton button) const { | 21 string16 ConfirmBubbleModel::GetButtonLabel(BubbleButton button) const { |
| 27 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_OK : IDS_CANCEL); | 22 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_OK : IDS_CANCEL); |
| 28 } | 23 } |
| 29 | 24 |
| 30 void ConfirmBubbleModel::Accept() { | 25 void ConfirmBubbleModel::Accept() { |
| 31 } | 26 } |
| 32 | 27 |
| 33 void ConfirmBubbleModel::Cancel() { | 28 void ConfirmBubbleModel::Cancel() { |
| 34 } | 29 } |
| 35 | 30 |
| 36 string16 ConfirmBubbleModel::GetLinkText() const { | 31 string16 ConfirmBubbleModel::GetLinkText() const { |
| 37 return string16(); | 32 return string16(); |
| 38 } | 33 } |
| 39 | 34 |
| 40 void ConfirmBubbleModel::LinkClicked() { | 35 void ConfirmBubbleModel::LinkClicked() { |
| 41 } | 36 } |
| 42 | |
| 43 void ConfirmBubbleModel::Show(gfx::NativeView view, | |
| 44 const gfx::Point& origin, | |
| 45 ConfirmBubbleModel* model) { | |
| 46 #if defined(TOOLKIT_VIEWS) | |
| 47 ConfirmBubbleView* bubble_view = new ConfirmBubbleView(origin, model); | |
| 48 browser::CreateViewsBubble(bubble_view); | |
| 49 bubble_view->Show(); | |
| 50 #else | |
| 51 NOTIMPLEMENTED(); // Bug 99130: Implement it. | |
| 52 #endif | |
| 53 } | |
| 54 | |
| OLD | NEW |