OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
8 #include "ash/launcher/launcher_model.h" | 8 #include "ash/launcher/launcher_model.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const char* name, | 59 const char* name, |
60 extension_misc::LaunchContainer container, | 60 extension_misc::LaunchContainer container, |
61 WindowOpenDisposition disposition) { | 61 WindowOpenDisposition disposition) { |
62 EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII(name))); | 62 EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII(name))); |
63 | 63 |
64 ExtensionService* service = browser()->profile()->GetExtensionService(); | 64 ExtensionService* service = browser()->profile()->GetExtensionService(); |
65 const Extension* extension = | 65 const Extension* extension = |
66 service->GetExtensionById(last_loaded_extension_id_, false); | 66 service->GetExtensionById(last_loaded_extension_id_, false); |
67 EXPECT_TRUE(extension); | 67 EXPECT_TRUE(extension); |
68 | 68 |
69 application_launch::OpenApplication( | 69 application_launch::OpenApplication(application_launch::LaunchParams( |
70 browser()->profile(), | 70 browser()->profile(), extension, container, disposition)); |
71 extension, | |
72 // Overriding manifest to open in a panel. | |
73 container, | |
74 GURL(), | |
75 disposition, | |
76 NULL); | |
77 return extension; | 71 return extension; |
78 } | 72 } |
79 | 73 |
80 ash::LauncherID CreateShortcut(const char* name) { | 74 ash::LauncherID CreateShortcut(const char* name) { |
81 ExtensionService* service = browser()->profile()->GetExtensionService(); | 75 ExtensionService* service = browser()->profile()->GetExtensionService(); |
82 LoadExtension(test_data_dir_.AppendASCII(name)); | 76 LoadExtension(test_data_dir_.AppendASCII(name)); |
83 | 77 |
84 // First get app_id. | 78 // First get app_id. |
85 const Extension* extension = | 79 const Extension* extension = |
86 service->GetExtensionById(last_loaded_extension_id_, false); | 80 service->GetExtensionById(last_loaded_extension_id_, false); |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 // Navigate away. | 583 // Navigate away. |
590 ui_test_utils::NavigateToURL( | 584 ui_test_utils::NavigateToURL( |
591 browser(), GURL("http://www.example.com/path0/bar.html")); | 585 browser(), GURL("http://www.example.com/path0/bar.html")); |
592 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); | 586 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); |
593 | 587 |
594 // Navigate back. | 588 // Navigate back. |
595 ui_test_utils::NavigateToURL( | 589 ui_test_utils::NavigateToURL( |
596 browser(), GURL("http://www.example.com/path1/foo.html")); | 590 browser(), GURL("http://www.example.com/path1/foo.html")); |
597 EXPECT_EQ(ash::STATUS_ACTIVE, (*model_->ItemByID(shortcut_id)).status); | 591 EXPECT_EQ(ash::STATUS_ACTIVE, (*model_->ItemByID(shortcut_id)).status); |
598 } | 592 } |
OLD | NEW |