OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
6 | |
7 #include <algorithm> | 6 #include <algorithm> |
8 #include <set> | 7 #include <set> |
| 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/prefs/pref_change_registrar.h" | 13 #include "base/prefs/pref_change_registrar.h" |
14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "chrome/app/chrome_command_ids.h" | 17 #include "chrome/app/chrome_command_ids.h" |
18 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 chrome_translate_client->GetLanguageState().original_language(); | 389 chrome_translate_client->GetLanguageState().original_language(); |
390 std::string target_language = | 390 std::string target_language = |
391 translate::TranslateDownloadManager::GetLanguageCode( | 391 translate::TranslateDownloadManager::GetLanguageCode( |
392 g_browser_process->GetApplicationLocale()); | 392 g_browser_process->GetApplicationLocale()); |
393 | 393 |
394 scoped_ptr<translate::TranslateUIDelegate> ui_delegate( | 394 scoped_ptr<translate::TranslateUIDelegate> ui_delegate( |
395 new translate::TranslateUIDelegate( | 395 new translate::TranslateUIDelegate( |
396 chrome_translate_client->GetTranslateManager()->GetWeakPtr(), | 396 chrome_translate_client->GetTranslateManager()->GetWeakPtr(), |
397 source_language, | 397 source_language, |
398 target_language)); | 398 target_language)); |
399 model_.reset(new TranslateBubbleModelImpl(step, ui_delegate.Pass())); | 399 model_.reset(new TranslateBubbleModelImpl(step, std::move(ui_delegate))); |
400 } | 400 } |
401 | 401 |
402 TranslateBubbleModel* model() { return model_.get(); } | 402 TranslateBubbleModel* model() { return model_.get(); } |
403 | 403 |
404 private: | 404 private: |
405 scoped_ptr<TranslateBubbleModel> model_; | 405 scoped_ptr<TranslateBubbleModel> model_; |
406 | 406 |
407 DISALLOW_COPY_AND_ASSIGN(MockTranslateBubbleFactory); | 407 DISALLOW_COPY_AND_ASSIGN(MockTranslateBubbleFactory); |
408 }; | 408 }; |
409 | 409 |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1679 | 1679 |
1680 // Check the bubble exists instead of the infobar. | 1680 // Check the bubble exists instead of the infobar. |
1681 translate::TranslateInfoBarDelegate* infobar = GetTranslateInfoBar(); | 1681 translate::TranslateInfoBarDelegate* infobar = GetTranslateInfoBar(); |
1682 ASSERT_TRUE(infobar == NULL); | 1682 ASSERT_TRUE(infobar == NULL); |
1683 TranslateBubbleModel* bubble = factory->model(); | 1683 TranslateBubbleModel* bubble = factory->model(); |
1684 ASSERT_TRUE(bubble != NULL); | 1684 ASSERT_TRUE(bubble != NULL); |
1685 EXPECT_EQ(TranslateBubbleModel::VIEW_STATE_TRANSLATING, | 1685 EXPECT_EQ(TranslateBubbleModel::VIEW_STATE_TRANSLATING, |
1686 bubble->GetViewState()); | 1686 bubble->GetViewState()); |
1687 } | 1687 } |
1688 #endif // defined(USE_AURA) | 1688 #endif // defined(USE_AURA) |
OLD | NEW |