Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 1135313003: [Android] Disable smart selection by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « android_webview/lib/main/aw_main_delegate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 == "character")
mfomitchev 2015/05/12 22:17:23 Nit: can get rid of the main clause and only leave
772 selection_strategy = WebSettings::SelectionStrategyType::Character; 764 selection_strategy = WebSettings::SelectionStrategyType::Character;
773 else if (selection_strategy_str == "direction") 765 else if (selection_strategy_str == "direction")
774 selection_strategy = WebSettings::SelectionStrategyType::Direction; 766 selection_strategy = WebSettings::SelectionStrategyType::Direction;
775 webview()->settings()->setSelectionStrategy(selection_strategy); 767 webview()->settings()->setSelectionStrategy(selection_strategy);
776 768
777 if (!params.frame_name.empty()) 769 if (!params.frame_name.empty())
778 webview()->mainFrame()->setName(params.frame_name); 770 webview()->mainFrame()->setName(params.frame_name);
779 771
780 // TODO(davidben): Move this state from Blink into content. 772 // TODO(davidben): Move this state from Blink into content.
781 if (params.window_was_created_with_opener) 773 if (params.window_was_created_with_opener)
(...skipping 2989 matching lines...) Expand 10 before | Expand all | Expand 10 after
3771 std::vector<gfx::Size> sizes; 3763 std::vector<gfx::Size> sizes;
3772 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 3764 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
3773 if (!url.isEmpty()) 3765 if (!url.isEmpty())
3774 urls.push_back( 3766 urls.push_back(
3775 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 3767 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
3776 } 3768 }
3777 SendUpdateFaviconURL(urls); 3769 SendUpdateFaviconURL(urls);
3778 } 3770 }
3779 3771
3780 } // namespace content 3772 } // namespace content
OLDNEW
« no previous file with comments | « android_webview/lib/main/aw_main_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698