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 "apps/app_window.h" | |
8 #include "apps/app_window_registry.h" | |
9 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
10 #include "ash/display/display_controller.h" | 8 #include "ash/display/display_controller.h" |
11 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
12 #include "ash/shelf/shelf_button.h" | 10 #include "ash/shelf/shelf_button.h" |
13 #include "ash/shelf/shelf_constants.h" | 11 #include "ash/shelf/shelf_constants.h" |
14 #include "ash/shelf/shelf_model.h" | 12 #include "ash/shelf/shelf_model.h" |
15 #include "ash/shelf/shelf_util.h" | 13 #include "ash/shelf/shelf_util.h" |
16 #include "ash/shelf/shelf_view.h" | 14 #include "ash/shelf/shelf_view.h" |
17 #include "ash/shell.h" | 15 #include "ash/shell.h" |
18 #include "ash/test/app_list_controller_test_api.h" | 16 #include "ash/test/app_list_controller_test_api.h" |
(...skipping 25 matching lines...) Expand all Loading... |
44 #include "chrome/browser/ui/extensions/application_launch.h" | 42 #include "chrome/browser/ui/extensions/application_launch.h" |
45 #include "chrome/browser/ui/host_desktop.h" | 43 #include "chrome/browser/ui/host_desktop.h" |
46 #include "chrome/browser/ui/settings_window_manager.h" | 44 #include "chrome/browser/ui/settings_window_manager.h" |
47 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 45 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
48 #include "chrome/common/chrome_switches.h" | 46 #include "chrome/common/chrome_switches.h" |
49 #include "chrome/test/base/ui_test_utils.h" | 47 #include "chrome/test/base/ui_test_utils.h" |
50 #include "content/public/browser/notification_service.h" | 48 #include "content/public/browser/notification_service.h" |
51 #include "content/public/browser/notification_source.h" | 49 #include "content/public/browser/notification_source.h" |
52 #include "content/public/browser/web_contents.h" | 50 #include "content/public/browser/web_contents.h" |
53 #include "content/public/test/browser_test_utils.h" | 51 #include "content/public/test/browser_test_utils.h" |
| 52 #include "extensions/browser/app_window/app_window.h" |
| 53 #include "extensions/browser/app_window/app_window_registry.h" |
54 #include "extensions/browser/app_window/native_app_window.h" | 54 #include "extensions/browser/app_window/native_app_window.h" |
55 #include "extensions/browser/extension_system.h" | 55 #include "extensions/browser/extension_system.h" |
56 #include "extensions/common/constants.h" | 56 #include "extensions/common/constants.h" |
57 #include "extensions/common/switches.h" | 57 #include "extensions/common/switches.h" |
58 #include "testing/gtest/include/gtest/gtest.h" | 58 #include "testing/gtest/include/gtest/gtest.h" |
59 #include "ui/app_list/views/apps_grid_view.h" | 59 #include "ui/app_list/views/apps_grid_view.h" |
60 #include "ui/aura/client/aura_constants.h" | 60 #include "ui/aura/client/aura_constants.h" |
61 #include "ui/aura/window.h" | 61 #include "ui/aura/window.h" |
62 #include "ui/events/event.h" | 62 #include "ui/events/event.h" |
63 #include "ui/events/test/event_generator.h" | 63 #include "ui/events/test/event_generator.h" |
64 | 64 |
65 using apps::AppWindow; | 65 using extensions::AppWindow; |
66 using extensions::Extension; | 66 using extensions::Extension; |
67 using content::WebContents; | 67 using content::WebContents; |
68 | 68 |
69 namespace { | 69 namespace { |
70 | 70 |
71 class TestEvent : public ui::Event { | 71 class TestEvent : public ui::Event { |
72 public: | 72 public: |
73 explicit TestEvent(ui::EventType type) | 73 explicit TestEvent(ui::EventType type) |
74 : ui::Event(type, base::TimeDelta(), 0) { | 74 : ui::Event(type, base::TimeDelta(), 0) { |
75 } | 75 } |
76 virtual ~TestEvent() { | 76 virtual ~TestEvent() { |
77 } | 77 } |
78 | 78 |
79 private: | 79 private: |
80 DISALLOW_COPY_AND_ASSIGN(TestEvent); | 80 DISALLOW_COPY_AND_ASSIGN(TestEvent); |
81 }; | 81 }; |
82 | 82 |
83 class TestAppWindowRegistryObserver : public apps::AppWindowRegistry::Observer { | 83 class TestAppWindowRegistryObserver |
| 84 : public extensions::AppWindowRegistry::Observer { |
84 public: | 85 public: |
85 explicit TestAppWindowRegistryObserver(Profile* profile) | 86 explicit TestAppWindowRegistryObserver(Profile* profile) |
86 : profile_(profile), icon_updates_(0) { | 87 : profile_(profile), icon_updates_(0) { |
87 apps::AppWindowRegistry::Get(profile_)->AddObserver(this); | 88 extensions::AppWindowRegistry::Get(profile_)->AddObserver(this); |
88 } | 89 } |
89 | 90 |
90 virtual ~TestAppWindowRegistryObserver() { | 91 virtual ~TestAppWindowRegistryObserver() { |
91 apps::AppWindowRegistry::Get(profile_)->RemoveObserver(this); | 92 extensions::AppWindowRegistry::Get(profile_)->RemoveObserver(this); |
92 } | 93 } |
93 | 94 |
94 // Overridden from AppWindowRegistry::Observer: | 95 // Overridden from AppWindowRegistry::Observer: |
95 virtual void OnAppWindowIconChanged(AppWindow* app_window) OVERRIDE { | 96 virtual void OnAppWindowIconChanged(AppWindow* app_window) OVERRIDE { |
96 ++icon_updates_; | 97 ++icon_updates_; |
97 } | 98 } |
98 | 99 |
99 int icon_updates() { return icon_updates_; } | 100 int icon_updates() { return icon_updates_; } |
100 | 101 |
101 private: | 102 private: |
(...skipping 2023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2125 chrome::GetSettingsUrl(std::string())); | 2126 chrome::GetSettingsUrl(std::string())); |
2126 Browser* settings_browser = | 2127 Browser* settings_browser = |
2127 settings_manager->FindBrowserForProfile(browser()->profile()); | 2128 settings_manager->FindBrowserForProfile(browser()->profile()); |
2128 ASSERT_TRUE(settings_browser); | 2129 ASSERT_TRUE(settings_browser); |
2129 EXPECT_EQ(browser_count, NumberOfDetectedLauncherBrowsers(false)); | 2130 EXPECT_EQ(browser_count, NumberOfDetectedLauncherBrowsers(false)); |
2130 EXPECT_EQ(item_count + 1, shelf_model->item_count()); | 2131 EXPECT_EQ(item_count + 1, shelf_model->item_count()); |
2131 | 2132 |
2132 // TODO(stevenjb): Test multiprofile on Chrome OS when test support is addded. | 2133 // TODO(stevenjb): Test multiprofile on Chrome OS when test support is addded. |
2133 // crbug.com/230464. | 2134 // crbug.com/230464. |
2134 } | 2135 } |
OLD | NEW |