| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer_context_menu/render_view_context_menu.h" | 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_registry_simple.h" | 7 #include "base/prefs/pref_registry_simple.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 // http://crbug.com/445599. | 380 // http://crbug.com/445599. |
| 381 PrefRegistrySimple* registry = | 381 PrefRegistrySimple* registry = |
| 382 drp_test_context_->pref_service()->registry(); | 382 drp_test_context_->pref_service()->registry(); |
| 383 registry->RegisterDictionaryPref(prefs::kProxy); | 383 registry->RegisterDictionaryPref(prefs::kProxy); |
| 384 | 384 |
| 385 drp_test_context_->pref_service()->SetBoolean( | 385 drp_test_context_->pref_service()->SetBoolean( |
| 386 data_reduction_proxy::prefs::kDataReductionProxyEnabled, | 386 data_reduction_proxy::prefs::kDataReductionProxyEnabled, |
| 387 enable_data_reduction_proxy); | 387 enable_data_reduction_proxy); |
| 388 drp_test_context_->InitSettings(); | 388 drp_test_context_->InitSettings(); |
| 389 | 389 |
| 390 base::FilePath profile_path; |
| 390 settings->InitDataReductionProxySettings( | 391 settings->InitDataReductionProxySettings( |
| 391 drp_test_context_->io_data(), drp_test_context_->pref_service(), | 392 drp_test_context_->io_data(), drp_test_context_->pref_service(), |
| 392 drp_test_context_->request_context_getter(), | 393 drp_test_context_->request_context_getter(), profile_path, |
| 394 base::ThreadTaskRunnerHandle::Get(), |
| 393 base::ThreadTaskRunnerHandle::Get()); | 395 base::ThreadTaskRunnerHandle::Get()); |
| 394 } | 396 } |
| 395 | 397 |
| 396 protected: | 398 protected: |
| 397 scoped_ptr<data_reduction_proxy::DataReductionProxyTestContext> | 399 scoped_ptr<data_reduction_proxy::DataReductionProxyTestContext> |
| 398 drp_test_context_; | 400 drp_test_context_; |
| 399 | 401 |
| 400 private: | 402 private: |
| 401 scoped_ptr<ProtocolHandlerRegistry> registry_; | 403 scoped_ptr<ProtocolHandlerRegistry> registry_; |
| 402 }; | 404 }; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 params.properties[data_reduction_proxy::chrome_proxy_header()] = | 480 params.properties[data_reduction_proxy::chrome_proxy_header()] = |
| 479 data_reduction_proxy::chrome_proxy_lo_fi_directive(); | 481 data_reduction_proxy::chrome_proxy_lo_fi_directive(); |
| 480 params.unfiltered_link_url = params.link_url; | 482 params.unfiltered_link_url = params.link_url; |
| 481 content::WebContents* wc = web_contents(); | 483 content::WebContents* wc = web_contents(); |
| 482 scoped_ptr<TestRenderViewContextMenu> menu( | 484 scoped_ptr<TestRenderViewContextMenu> menu( |
| 483 new TestRenderViewContextMenu(wc->GetMainFrame(), params)); | 485 new TestRenderViewContextMenu(wc->GetMainFrame(), params)); |
| 484 AppendImageItems(menu.get()); | 486 AppendImageItems(menu.get()); |
| 485 | 487 |
| 486 ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_LOAD_ORIGINAL_IMAGE)); | 488 ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_LOAD_ORIGINAL_IMAGE)); |
| 487 } | 489 } |
| OLD | NEW |