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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 webview()->setMainFrame(main_render_frame_->GetWebFrame()); | 748 webview()->setMainFrame(main_render_frame_->GetWebFrame()); |
749 } | 749 } |
750 main_render_frame_->Initialize(); | 750 main_render_frame_->Initialize(); |
751 | 751 |
752 if (switches::IsTouchDragDropEnabled()) | 752 if (switches::IsTouchDragDropEnabled()) |
753 webview()->settings()->setTouchDragDropEnabled(true); | 753 webview()->settings()->setTouchDragDropEnabled(true); |
754 | 754 |
755 if (switches::IsTouchEditingEnabled()) | 755 if (switches::IsTouchEditingEnabled()) |
756 webview()->settings()->setTouchEditingEnabled(true); | 756 webview()->settings()->setTouchEditingEnabled(true); |
757 | 757 |
758 #if defined(OS_ANDROID) | 758 WebSettings::SelectionStrategyType selection_strategy = |
759 WebSettings::SelectionStrategyType selection_strategy_default = | |
760 WebSettings::SelectionStrategyType::Direction; | |
761 #else | |
762 WebSettings::SelectionStrategyType selection_strategy_default = | |
763 WebSettings::SelectionStrategyType::Character; | 759 WebSettings::SelectionStrategyType::Character; |
764 #endif | |
765 | |
766 WebSettings::SelectionStrategyType selection_strategy = | |
767 selection_strategy_default; | |
768 const std::string selection_strategy_str = | 760 const std::string selection_strategy_str = |
769 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 761 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
770 switches::kTouchTextSelectionStrategy); | 762 switches::kTouchTextSelectionStrategy); |
771 if (selection_strategy_str == "character") | 763 if (selection_strategy_str == "direction") |
772 selection_strategy = WebSettings::SelectionStrategyType::Character; | |
773 else if (selection_strategy_str == "direction") | |
774 selection_strategy = WebSettings::SelectionStrategyType::Direction; | 764 selection_strategy = WebSettings::SelectionStrategyType::Direction; |
775 webview()->settings()->setSelectionStrategy(selection_strategy); | 765 webview()->settings()->setSelectionStrategy(selection_strategy); |
776 | 766 |
777 if (!params.frame_name.empty()) | 767 if (!params.frame_name.empty()) |
778 webview()->mainFrame()->setName(params.frame_name); | 768 webview()->mainFrame()->setName(params.frame_name); |
779 | 769 |
780 // TODO(davidben): Move this state from Blink into content. | 770 // TODO(davidben): Move this state from Blink into content. |
781 if (params.window_was_created_with_opener) | 771 if (params.window_was_created_with_opener) |
782 webview()->setOpenedByDOM(); | 772 webview()->setOpenedByDOM(); |
783 | 773 |
(...skipping 2987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3771 std::vector<gfx::Size> sizes; | 3761 std::vector<gfx::Size> sizes; |
3772 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3762 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
3773 if (!url.isEmpty()) | 3763 if (!url.isEmpty()) |
3774 urls.push_back( | 3764 urls.push_back( |
3775 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3765 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
3776 } | 3766 } |
3777 SendUpdateFaviconURL(urls); | 3767 SendUpdateFaviconURL(urls); |
3778 } | 3768 } |
3779 | 3769 |
3780 } // namespace content | 3770 } // namespace content |
OLD | NEW |