Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / views / translate / translate_bubble_test_utils_views.cc
blob5681592c0e2fd3945247f4cf6fd83baef2b72434
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/translate/translate_bubble_test_utils.h"
7 #include "base/logging.h"
8 #include "chrome/browser/ui/translate/translate_bubble_model.h"
9 #include "chrome/browser/ui/views/translate/translate_bubble_view.h"
11 namespace translate {
13 namespace test_utils {
15 const TranslateBubbleModel* GetCurrentModel(Browser* browser) {
16 DCHECK(browser);
17 TranslateBubbleView* view = TranslateBubbleView::GetCurrentBubble();
18 return view ? view->model() : nullptr;
21 void PressTranslate(Browser* browser) {
22 DCHECK(browser);
23 TranslateBubbleView* bubble = TranslateBubbleView::GetCurrentBubble();
24 DCHECK(bubble);
25 bubble->HandleButtonPressed(TranslateBubbleView::BUTTON_ID_TRANSLATE);
28 } // namespace test_utils
30 } // namespace translate