| 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/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 return menu; | 392 return menu; |
| 393 } | 393 } |
| 394 | 394 |
| 395 void AppendImageItems(TestRenderViewContextMenu* menu) { | 395 void AppendImageItems(TestRenderViewContextMenu* menu) { |
| 396 menu->AppendImageItems(); | 396 menu->AppendImageItems(); |
| 397 } | 397 } |
| 398 | 398 |
| 399 void SetupDataReductionProxy(bool enable_data_reduction_proxy) { | 399 void SetupDataReductionProxy(bool enable_data_reduction_proxy) { |
| 400 drp_test_context_ = | 400 drp_test_context_ = |
| 401 data_reduction_proxy::DataReductionProxyTestContext::Builder() | 401 data_reduction_proxy::DataReductionProxyTestContext::Builder() |
| 402 .WithParamsFlags( | |
| 403 data_reduction_proxy::DataReductionProxyParams::kPromoAllowed) | |
| 404 .WithMockConfig() | 402 .WithMockConfig() |
| 405 .SkipSettingsInitialization() | 403 .SkipSettingsInitialization() |
| 406 .Build(); | 404 .Build(); |
| 407 | 405 |
| 408 DataReductionProxyChromeSettings* settings = | 406 DataReductionProxyChromeSettings* settings = |
| 409 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( | 407 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( |
| 410 profile()); | 408 profile()); |
| 411 | 409 |
| 412 // TODO(bengr): Remove proxy_config::prefs::kProxy registration after M46. | 410 // TODO(bengr): Remove proxy_config::prefs::kProxy registration after M46. |
| 413 // See http://crbug.com/445599. | 411 // See http://crbug.com/445599. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 params.unfiltered_link_url = params.link_url; | 541 params.unfiltered_link_url = params.link_url; |
| 544 content::WebContents* wc = web_contents(); | 542 content::WebContents* wc = web_contents(); |
| 545 std::unique_ptr<TestRenderViewContextMenu> menu( | 543 std::unique_ptr<TestRenderViewContextMenu> menu( |
| 546 new TestRenderViewContextMenu(wc->GetMainFrame(), params)); | 544 new TestRenderViewContextMenu(wc->GetMainFrame(), params)); |
| 547 AppendImageItems(menu.get()); | 545 AppendImageItems(menu.get()); |
| 548 | 546 |
| 549 ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_LOAD_ORIGINAL_IMAGE)); | 547 ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_LOAD_ORIGINAL_IMAGE)); |
| 550 | 548 |
| 551 DestroyDataReductionProxySettings(); | 549 DestroyDataReductionProxySettings(); |
| 552 } | 550 } |
| OLD | NEW |