| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "chrome/browser/extensions/active_script_controller.h" | 10 #include "chrome/browser/extensions/active_script_controller.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 .Set("permissions", ListBuilder().Append("tabs")); | 73 .Set("permissions", ListBuilder().Append("tabs")); |
| 74 if (has_page_actions) { | 74 if (has_page_actions) { |
| 75 manifest.Set("page_action", DictionaryBuilder() | 75 manifest.Set("page_action", DictionaryBuilder() |
| 76 .Set("default_title", "Hello")); | 76 .Set("default_title", "Hello")); |
| 77 } | 77 } |
| 78 scoped_refptr<const Extension> extension = | 78 scoped_refptr<const Extension> extension = |
| 79 ExtensionBuilder().SetManifest(manifest.Pass()) | 79 ExtensionBuilder().SetManifest(manifest.Pass()) |
| 80 .SetID(crx_file::id_util::GenerateId(name)) | 80 .SetID(crx_file::id_util::GenerateId(name)) |
| 81 .Build(); | 81 .Build(); |
| 82 extension_service_->AddExtension(extension.get()); | 82 extension_service_->AddExtension(extension.get()); |
| 83 return extension; | 83 return extension.get(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 ExtensionService* extension_service_; | 86 ExtensionService* extension_service_; |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 #if defined OS_CHROMEOS | 89 #if defined OS_CHROMEOS |
| 90 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; | 90 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; |
| 91 chromeos::ScopedTestCrosSettings test_cros_settings_; | 91 chromeos::ScopedTestCrosSettings test_cros_settings_; |
| 92 scoped_ptr<chromeos::ScopedTestUserManager> test_user_manager_; | 92 scoped_ptr<chromeos::ScopedTestUserManager> test_user_manager_; |
| 93 #endif | 93 #endif |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 // Should discard the settings, and go back to the defaults. | 173 // Should discard the settings, and go back to the defaults. |
| 174 NavigateAndCommit(GURL("http://www.yahoo.com")); | 174 NavigateAndCommit(GURL("http://www.yahoo.com")); |
| 175 | 175 |
| 176 EXPECT_EQ("Hello", page_action.GetTitle(tab_id())); | 176 EXPECT_EQ("Hello", page_action.GetTitle(tab_id())); |
| 177 EXPECT_EQ(GURL(), page_action.GetPopupUrl(tab_id())); | 177 EXPECT_EQ(GURL(), page_action.GetPopupUrl(tab_id())); |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace | 180 } // namespace |
| 181 } // namespace extensions | 181 } // namespace extensions |
| OLD | NEW |