OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "content/public/browser/web_contents.h" | 48 #include "content/public/browser/web_contents.h" |
49 #include "extensions/common/extension.h" | 49 #include "extensions/common/extension.h" |
50 #include "extensions/common/manifest_constants.h" | 50 #include "extensions/common/manifest_constants.h" |
51 #include "testing/gtest/include/gtest/gtest.h" | 51 #include "testing/gtest/include/gtest/gtest.h" |
52 #include "ui/aura/client/window_tree_client.h" | 52 #include "ui/aura/client/window_tree_client.h" |
53 #include "ui/base/models/menu_model.h" | 53 #include "ui/base/models/menu_model.h" |
54 | 54 |
55 #if defined(OS_CHROMEOS) | 55 #if defined(OS_CHROMEOS) |
56 #include "ash/test/test_session_state_delegate.h" | 56 #include "ash/test/test_session_state_delegate.h" |
57 #include "ash/test/test_shell_delegate.h" | 57 #include "ash/test/test_shell_delegate.h" |
58 #include "chrome/browser/apps/scoped_keep_alive.h" | |
59 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 58 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
60 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 59 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
61 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 60 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 61 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
62 #include "chrome/browser/ui/apps/chrome_app_delegate.h" | 62 #include "chrome/browser/ui/apps/chrome_app_delegate.h" |
63 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" | 63 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" |
64 #include "chrome/browser/ui/ash/launcher/browser_status_monitor.h" | 64 #include "chrome/browser/ui/ash/launcher/browser_status_monitor.h" |
65 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 65 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
66 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 66 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
67 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" | 67 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" |
68 #include "chrome/common/chrome_constants.h" | 68 #include "chrome/common/chrome_constants.h" |
69 #include "chrome/common/chrome_switches.h" | 69 #include "chrome/common/chrome_switches.h" |
70 #include "chrome/test/base/testing_browser_process.h" | 70 #include "chrome/test/base/testing_browser_process.h" |
71 #include "chrome/test/base/testing_profile_manager.h" | 71 #include "chrome/test/base/testing_profile_manager.h" |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 scoped_ptr<aura::Window> native_window_; | 739 scoped_ptr<aura::Window> native_window_; |
740 | 740 |
741 DISALLOW_COPY_AND_ASSIGN(V1App); | 741 DISALLOW_COPY_AND_ASSIGN(V1App); |
742 }; | 742 }; |
743 | 743 |
744 // A V2 application which gets created with an |extension| and for a |profile|. | 744 // A V2 application which gets created with an |extension| and for a |profile|. |
745 // Upon destruction it will properly close the application. | 745 // Upon destruction it will properly close the application. |
746 class V2App { | 746 class V2App { |
747 public: | 747 public: |
748 V2App(Profile* profile, const extensions::Extension* extension) { | 748 V2App(Profile* profile, const extensions::Extension* extension) { |
749 window_ = new extensions::AppWindow( | 749 window_ = new extensions::AppWindow(profile, new ChromeAppDelegate(true), |
750 profile, | 750 extension); |
751 new ChromeAppDelegate(make_scoped_ptr(new ScopedKeepAlive)), | |
752 extension); | |
753 extensions::AppWindow::CreateParams params = | 751 extensions::AppWindow::CreateParams params = |
754 extensions::AppWindow::CreateParams(); | 752 extensions::AppWindow::CreateParams(); |
755 window_->Init(GURL(std::string()), | 753 window_->Init(GURL(std::string()), |
756 new extensions::AppWindowContentsImpl(window_), params); | 754 new extensions::AppWindowContentsImpl(window_), params); |
757 } | 755 } |
758 | 756 |
759 virtual ~V2App() { | 757 virtual ~V2App() { |
760 WebContentsDestroyedWatcher destroyed_watcher(window_->web_contents()); | 758 WebContentsDestroyedWatcher destroyed_watcher(window_->web_contents()); |
761 window_->GetBaseWindow()->Close(); | 759 window_->GetBaseWindow()->Close(); |
762 destroyed_watcher.Wait(); | 760 destroyed_watcher.Wait(); |
(...skipping 2088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2851 EXPECT_EQ(1, app_icon_loader1->clear_count()); | 2849 EXPECT_EQ(1, app_icon_loader1->clear_count()); |
2852 EXPECT_EQ(1, app_icon_loader2->fetch_count()); | 2850 EXPECT_EQ(1, app_icon_loader2->fetch_count()); |
2853 EXPECT_EQ(1, app_icon_loader2->clear_count()); | 2851 EXPECT_EQ(1, app_icon_loader2->clear_count()); |
2854 | 2852 |
2855 launcher_controller_->CloseLauncherItem(shelfId3); | 2853 launcher_controller_->CloseLauncherItem(shelfId3); |
2856 EXPECT_EQ(1, app_icon_loader1->fetch_count()); | 2854 EXPECT_EQ(1, app_icon_loader1->fetch_count()); |
2857 EXPECT_EQ(1, app_icon_loader1->clear_count()); | 2855 EXPECT_EQ(1, app_icon_loader1->clear_count()); |
2858 EXPECT_EQ(1, app_icon_loader2->fetch_count()); | 2856 EXPECT_EQ(1, app_icon_loader2->fetch_count()); |
2859 EXPECT_EQ(1, app_icon_loader2->clear_count()); | 2857 EXPECT_EQ(1, app_icon_loader2->clear_count()); |
2860 } | 2858 } |
OLD | NEW |