| 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 } | 381 } |
| 382 | 382 |
| 383 void AppendImageItems(TestRenderViewContextMenu* menu) { | 383 void AppendImageItems(TestRenderViewContextMenu* menu) { |
| 384 menu->AppendImageItems(); | 384 menu->AppendImageItems(); |
| 385 } | 385 } |
| 386 | 386 |
| 387 void SetupDataReductionProxy(bool enable_data_reduction_proxy) { | 387 void SetupDataReductionProxy(bool enable_data_reduction_proxy) { |
| 388 drp_test_context_ = | 388 drp_test_context_ = |
| 389 data_reduction_proxy::DataReductionProxyTestContext::Builder() | 389 data_reduction_proxy::DataReductionProxyTestContext::Builder() |
| 390 .WithParamsFlags( | 390 .WithParamsFlags( |
| 391 data_reduction_proxy::DataReductionProxyParams::kAllowed | | |
| 392 data_reduction_proxy::DataReductionProxyParams:: | |
| 393 kFallbackAllowed | | |
| 394 data_reduction_proxy::DataReductionProxyParams::kPromoAllowed) | 391 data_reduction_proxy::DataReductionProxyParams::kPromoAllowed) |
| 395 .WithMockConfig() | 392 .WithMockConfig() |
| 396 .SkipSettingsInitialization() | 393 .SkipSettingsInitialization() |
| 397 .Build(); | 394 .Build(); |
| 398 | 395 |
| 399 DataReductionProxyChromeSettings* settings = | 396 DataReductionProxyChromeSettings* settings = |
| 400 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( | 397 DataReductionProxyChromeSettingsFactory::GetForBrowserContext( |
| 401 profile()); | 398 profile()); |
| 402 | 399 |
| 403 // TODO(bengr): Remove proxy_config::prefs::kProxy registration after M46. | 400 // TODO(bengr): Remove proxy_config::prefs::kProxy registration after M46. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 params.unfiltered_link_url = params.link_url; | 520 params.unfiltered_link_url = params.link_url; |
| 524 content::WebContents* wc = web_contents(); | 521 content::WebContents* wc = web_contents(); |
| 525 std::unique_ptr<TestRenderViewContextMenu> menu( | 522 std::unique_ptr<TestRenderViewContextMenu> menu( |
| 526 new TestRenderViewContextMenu(wc->GetMainFrame(), params)); | 523 new TestRenderViewContextMenu(wc->GetMainFrame(), params)); |
| 527 AppendImageItems(menu.get()); | 524 AppendImageItems(menu.get()); |
| 528 | 525 |
| 529 ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_LOAD_ORIGINAL_IMAGE)); | 526 ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_LOAD_ORIGINAL_IMAGE)); |
| 530 | 527 |
| 531 DestroyDataReductionProxySettings(); | 528 DestroyDataReductionProxySettings(); |
| 532 } | 529 } |
| OLD | NEW |