| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/message_box_flags.h" | 5 #include "app/message_box_flags.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "chrome/browser/pref_service.h" | 7 #include "chrome/browser/pref_service.h" |
| 8 #include "chrome/browser/pref_value_store.h" | 8 #include "chrome/browser/pref_value_store.h" |
| 9 #include "chrome/browser/renderer_host/render_view_host.h" | 9 #include "chrome/browser/renderer_host/render_view_host.h" |
| 10 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 10 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 virtual PrefService* GetPrefs() { | 48 virtual PrefService* GetPrefs() { |
| 49 if (!prefs_.get()) { | 49 if (!prefs_.get()) { |
| 50 FilePath source_path; | 50 FilePath source_path; |
| 51 PathService::Get(chrome::DIR_TEST_DATA, &source_path); | 51 PathService::Get(chrome::DIR_TEST_DATA, &source_path); |
| 52 source_path = source_path.AppendASCII("profiles") | 52 source_path = source_path.AppendASCII("profiles") |
| 53 .AppendASCII("chrome_prefs").AppendASCII("Preferences"); | 53 .AppendASCII("chrome_prefs").AppendASCII("Preferences"); |
| 54 | 54 |
| 55 // Create a preference service that only contains user defined | 55 // Create a preference service that only contains user defined |
| 56 // preference values. | 56 // preference values. |
| 57 prefs_.reset(new PrefService(new PrefValueStore( | 57 prefs_.reset(PrefService::CreateUserPrefService(source_path)); |
| 58 NULL, /* No managed preference values */ | |
| 59 new JsonPrefStore( /* user defined preference values */ | |
| 60 source_path, | |
| 61 ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE)), | |
| 62 NULL /* No suggested preference values */))); | |
| 63 Profile::RegisterUserPrefs(prefs_.get()); | 58 Profile::RegisterUserPrefs(prefs_.get()); |
| 64 browser::RegisterAllPrefs(prefs_.get(), prefs_.get()); | 59 browser::RegisterAllPrefs(prefs_.get(), prefs_.get()); |
| 65 } | 60 } |
| 66 return prefs_.get(); | 61 return prefs_.get(); |
| 67 } | 62 } |
| 68 }; | 63 }; |
| 69 | 64 |
| 70 class TestInterstitialPage : public InterstitialPage { | 65 class TestInterstitialPage : public InterstitialPage { |
| 71 public: | 66 public: |
| 72 enum InterstitialState { | 67 enum InterstitialState { |
| (...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 | 1467 |
| 1473 // While the interstitial is showing, let's simulate the hidden page | 1468 // While the interstitial is showing, let's simulate the hidden page |
| 1474 // attempting to show a JS message. | 1469 // attempting to show a JS message. |
| 1475 IPC::Message* dummy_message = new IPC::Message; | 1470 IPC::Message* dummy_message = new IPC::Message; |
| 1476 bool did_suppress_message = false; | 1471 bool did_suppress_message = false; |
| 1477 contents()->RunJavaScriptMessage(L"This is an informative message", L"OK", | 1472 contents()->RunJavaScriptMessage(L"This is an informative message", L"OK", |
| 1478 kGURL, MessageBoxFlags::kIsJavascriptAlert, dummy_message, | 1473 kGURL, MessageBoxFlags::kIsJavascriptAlert, dummy_message, |
| 1479 &did_suppress_message); | 1474 &did_suppress_message); |
| 1480 EXPECT_TRUE(did_suppress_message); | 1475 EXPECT_TRUE(did_suppress_message); |
| 1481 } | 1476 } |
| OLD | NEW |