| 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 #import "chrome/browser/ui/cocoa/infobars/translate_infobar_base.h" | 5 #import "chrome/browser/ui/cocoa/infobars/translate_infobar_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "grit/components_strings.h" | 25 #include "grit/components_strings.h" |
| 26 #include "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutT
weaker.h" | 26 #include "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutT
weaker.h" |
| 27 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
| 28 | 28 |
| 29 using InfoBarUtilities::MoveControl; | 29 using InfoBarUtilities::MoveControl; |
| 30 using InfoBarUtilities::VerticallyCenterView; | 30 using InfoBarUtilities::VerticallyCenterView; |
| 31 using InfoBarUtilities::VerifyControlOrderAndSpacing; | 31 using InfoBarUtilities::VerifyControlOrderAndSpacing; |
| 32 using InfoBarUtilities::CreateLabel; | 32 using InfoBarUtilities::CreateLabel; |
| 33 using InfoBarUtilities::AddMenuItem; | 33 using InfoBarUtilities::AddMenuItem; |
| 34 | 34 |
| 35 scoped_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( | 35 std::unique_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( |
| 36 scoped_ptr<translate::TranslateInfoBarDelegate> delegate) const { | 36 std::unique_ptr<translate::TranslateInfoBarDelegate> delegate) const { |
| 37 scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); | 37 std::unique_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); |
| 38 base::scoped_nsobject<TranslateInfoBarControllerBase> infobar_controller; | 38 base::scoped_nsobject<TranslateInfoBarControllerBase> infobar_controller; |
| 39 switch (infobar->delegate()->AsTranslateInfoBarDelegate()->translate_step()) { | 39 switch (infobar->delegate()->AsTranslateInfoBarDelegate()->translate_step()) { |
| 40 case translate::TRANSLATE_STEP_BEFORE_TRANSLATE: | 40 case translate::TRANSLATE_STEP_BEFORE_TRANSLATE: |
| 41 infobar_controller.reset([[BeforeTranslateInfobarController alloc] | 41 infobar_controller.reset([[BeforeTranslateInfobarController alloc] |
| 42 initWithInfoBar:infobar.get()]); | 42 initWithInfoBar:infobar.get()]); |
| 43 break; | 43 break; |
| 44 case translate::TRANSLATE_STEP_AFTER_TRANSLATE: | 44 case translate::TRANSLATE_STEP_AFTER_TRANSLATE: |
| 45 infobar_controller.reset([[AfterTranslateInfobarController alloc] | 45 infobar_controller.reset([[AfterTranslateInfobarController alloc] |
| 46 initWithInfoBar:infobar.get()]); | 46 initWithInfoBar:infobar.get()]); |
| 47 break; | 47 break; |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 [[control description] UTF8String] <<[title UTF8String]; | 554 [[control description] UTF8String] <<[title UTF8String]; |
| 555 return false; | 555 return false; |
| 556 } | 556 } |
| 557 previousControl = control; | 557 previousControl = control; |
| 558 } | 558 } |
| 559 | 559 |
| 560 return true; | 560 return true; |
| 561 } | 561 } |
| 562 | 562 |
| 563 @end // TranslateInfoBarControllerBase (TestingAPI) | 563 @end // TranslateInfoBarControllerBase (TestingAPI) |
| OLD | NEW |