| 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/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" | 
| 6 | 6 | 
| 7 #include <vector> | 7 #include <vector> | 
| 8 | 8 | 
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" | 
| 10 #include "chrome/renderer/searchbox/search_bouncer.h" | 10 #include "chrome/renderer/searchbox/search_bouncer.h" | 
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 91   int flags = is_from_webstore ? | 91   int flags = is_from_webstore ? | 
| 92       extensions::Extension::FROM_WEBSTORE: | 92       extensions::Extension::FROM_WEBSTORE: | 
| 93       extensions::Extension::NO_FLAGS; | 93       extensions::Extension::NO_FLAGS; | 
| 94 | 94 | 
| 95   base::DictionaryValue manifest; | 95   base::DictionaryValue manifest; | 
| 96   manifest.SetString("name", "NaCl Extension"); | 96   manifest.SetString("name", "NaCl Extension"); | 
| 97   manifest.SetString("version", "1"); | 97   manifest.SetString("version", "1"); | 
| 98   manifest.SetInteger("manifest_version", 2); | 98   manifest.SetInteger("manifest_version", 2); | 
| 99   if (is_hosted_app) { | 99   if (is_hosted_app) { | 
| 100     base::ListValue* url_list = new base::ListValue(); | 100     base::ListValue* url_list = new base::ListValue(); | 
| 101     url_list->Append(base::Value::CreateStringValue(app_url)); | 101     url_list->Append(new base::StringValue(app_url)); | 
| 102     manifest.Set(extensions::manifest_keys::kWebURLs, url_list); | 102     manifest.Set(extensions::manifest_keys::kWebURLs, url_list); | 
| 103     manifest.SetString(extensions::manifest_keys::kLaunchWebURL, app_url); | 103     manifest.SetString(extensions::manifest_keys::kLaunchWebURL, app_url); | 
| 104   } | 104   } | 
| 105   std::string error; | 105   std::string error; | 
| 106   return extensions::Extension::Create(base::FilePath(), location, manifest, | 106   return extensions::Extension::Create(base::FilePath(), location, manifest, | 
| 107                                        flags, &error); | 107                                        flags, &error); | 
| 108 } | 108 } | 
| 109 | 109 | 
| 110 scoped_refptr<const extensions::Extension> CreateExtension( | 110 scoped_refptr<const extensions::Extension> CreateExtension( | 
| 111     bool is_unrestricted, bool is_from_webstore) { | 111     bool is_unrestricted, bool is_from_webstore) { | 
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 394 TEST_F(ChromeContentRendererClientTest, ShouldSuppressErrorPage) { | 394 TEST_F(ChromeContentRendererClientTest, ShouldSuppressErrorPage) { | 
| 395   ChromeContentRendererClient client; | 395   ChromeContentRendererClient client; | 
| 396   client.search_bouncer_.reset(new SearchBouncer); | 396   client.search_bouncer_.reset(new SearchBouncer); | 
| 397   client.search_bouncer_->OnSetSearchURLs( | 397   client.search_bouncer_->OnSetSearchURLs( | 
| 398       std::vector<GURL>(), GURL("http://example.com/n")); | 398       std::vector<GURL>(), GURL("http://example.com/n")); | 
| 399   EXPECT_FALSE(client.ShouldSuppressErrorPage(NULL, | 399   EXPECT_FALSE(client.ShouldSuppressErrorPage(NULL, | 
| 400                                               GURL("http://example.com"))); | 400                                               GURL("http://example.com"))); | 
| 401   EXPECT_TRUE(client.ShouldSuppressErrorPage(NULL, | 401   EXPECT_TRUE(client.ShouldSuppressErrorPage(NULL, | 
| 402                                              GURL("http://example.com/n"))); | 402                                              GURL("http://example.com/n"))); | 
| 403 } | 403 } | 
| OLD | NEW | 
|---|