OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 #include "chrome/browser/ui/browser_commands.h" | 6 #include "chrome/browser/ui/browser_commands.h" |
7 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 7 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
8 #include "chrome/browser/ui/toolbar/media_router_action.h" | 8 #include "chrome/browser/ui/toolbar/media_router_action.h" |
9 #include "chrome/browser/ui/toolbar/toolbar_action_view_delegate.h" | 9 #include "chrome/browser/ui/toolbar/toolbar_action_view_delegate.h" |
10 #include "chrome/browser/ui/views/frame/browser_view.h" | 10 #include "chrome/browser/ui/views/frame/browser_view.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 void SetUpOnMainThread() override { | 27 void SetUpOnMainThread() override { |
28 InProcessBrowserTest::SetUpOnMainThread(); | 28 InProcessBrowserTest::SetUpOnMainThread(); |
29 | 29 |
30 BrowserActionsContainer* browser_actions_container = | 30 BrowserActionsContainer* browser_actions_container = |
31 BrowserView::GetBrowserViewForBrowser(browser()) | 31 BrowserView::GetBrowserViewForBrowser(browser()) |
32 ->toolbar() | 32 ->toolbar() |
33 ->browser_actions(); | 33 ->browser_actions(); |
34 ASSERT_TRUE(browser_actions_container); | 34 ASSERT_TRUE(browser_actions_container); |
35 | 35 |
36 media_router_action_.reset(new MediaRouterAction); | 36 media_router_action_.reset(new MediaRouterAction(browser())); |
37 | 37 |
38 // Sets delegate on |media_router_action_|. | 38 // Sets delegate on |media_router_action_|. |
39 toolbar_action_view_.reset( | 39 toolbar_action_view_.reset( |
40 new ToolbarActionView(media_router_action_.get(), browser()->profile(), | 40 new ToolbarActionView(media_router_action_.get(), browser()->profile(), |
41 browser_actions_container)); | 41 browser_actions_container)); |
42 } | 42 } |
43 | 43 |
44 void OpenMediaRouterDialogAndWaitForNewWebContents() { | 44 void OpenMediaRouterDialogAndWaitForNewWebContents() { |
45 content::TestNavigationObserver nav_observer(NULL); | 45 content::TestNavigationObserver nav_observer(NULL); |
46 nav_observer.StartWatchingNewWebContents(); | 46 nav_observer.StartWatchingNewWebContents(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 browser()->tab_strip_model()->GetActiveWebContents(), 1); | 80 browser()->tab_strip_model()->GetActiveWebContents(), 1); |
81 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 81 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
82 nav_observer.Wait(); | 82 nav_observer.Wait(); |
83 | 83 |
84 // The navigation should have removed the previously created dialog. | 84 // The navigation should have removed the previously created dialog. |
85 // We expect a new dialog WebContents to be created by calling this. | 85 // We expect a new dialog WebContents to be created by calling this. |
86 OpenMediaRouterDialogAndWaitForNewWebContents(); | 86 OpenMediaRouterDialogAndWaitForNewWebContents(); |
87 } | 87 } |
88 | 88 |
89 } // namespace media_router | 89 } // namespace media_router |
OLD | NEW |