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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 12041078: Clear the clipboard closing Incognito window (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge and compilation fixes Created 7 years, 10 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
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/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "content/browser/renderer_host/backing_store_aura.h" 14 #include "content/browser/renderer_host/backing_store_aura.h"
15 #include "content/browser/renderer_host/dip_util.h" 15 #include "content/browser/renderer_host/dip_util.h"
16 #include "content/browser/renderer_host/overscroll_controller.h" 16 #include "content/browser/renderer_host/overscroll_controller.h"
17 #include "content/browser/renderer_host/render_view_host_delegate.h" 17 #include "content/browser/renderer_host/render_view_host_delegate.h"
18 #include "content/browser/renderer_host/render_widget_host_impl.h" 18 #include "content/browser/renderer_host/render_widget_host_impl.h"
19 #include "content/browser/renderer_host/ui_events_helper.h" 19 #include "content/browser/renderer_host/ui_events_helper.h"
20 #include "content/browser/renderer_host/web_input_event_aura.h" 20 #include "content/browser/renderer_host/web_input_event_aura.h"
21 #include "content/common/gpu/client/gl_helper.h" 21 #include "content/common/gpu/client/gl_helper.h"
22 #include "content/common/gpu/gpu_messages.h" 22 #include "content/common/gpu/gpu_messages.h"
23 #include "content/common/view_messages.h" 23 #include "content/common/view_messages.h"
24 #include "content/port/browser/render_widget_host_view_port.h" 24 #include "content/port/browser/render_widget_host_view_port.h"
25 #include "content/public/browser/browser_context.h"
25 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
27 #include "content/public/browser/render_process_host.h"
26 #include "content/public/browser/render_view_host.h" 28 #include "content/public/browser/render_view_host.h"
27 #include "content/public/browser/user_metrics.h" 29 #include "content/public/browser/user_metrics.h"
28 #include "content/public/common/content_switches.h" 30 #include "content/public/common/content_switches.h"
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h" 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h"
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h"
32 #include "ui/aura/client/activation_client.h" 34 #include "ui/aura/client/activation_client.h"
33 #include "ui/aura/client/aura_constants.h" 35 #include "ui/aura/client/aura_constants.h"
34 #include "ui/aura/client/cursor_client.h" 36 #include "ui/aura/client/cursor_client.h"
35 #include "ui/aura/client/focus_client.h" 37 #include "ui/aura/client/focus_client.h"
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 868
867 void RenderWidgetHostViewAura::SelectionChanged(const string16& text, 869 void RenderWidgetHostViewAura::SelectionChanged(const string16& text,
868 size_t offset, 870 size_t offset,
869 const ui::Range& range) { 871 const ui::Range& range) {
870 RenderWidgetHostViewBase::SelectionChanged(text, offset, range); 872 RenderWidgetHostViewBase::SelectionChanged(text, offset, range);
871 873
872 #if defined(USE_X11) && !defined(OS_CHROMEOS) 874 #if defined(USE_X11) && !defined(OS_CHROMEOS)
873 if (text.empty() || range.is_empty()) 875 if (text.empty() || range.is_empty())
874 return; 876 return;
875 877
878 BrowserContext* browser_context = host_->GetProcess()->GetBrowserContext();
876 // Set the BUFFER_SELECTION to the ui::Clipboard. 879 // Set the BUFFER_SELECTION to the ui::Clipboard.
877 ui::ScopedClipboardWriter clipboard_writer( 880 ui::ScopedClipboardWriter clipboard_writer(
878 ui::Clipboard::GetForCurrentThread(), 881 ui::Clipboard::GetForCurrentThread(),
879 ui::Clipboard::BUFFER_SELECTION); 882 ui::Clipboard::BUFFER_SELECTION,
883 BrowserContext::GetMarkerForOffTheRecordContext(browser_context));
880 clipboard_writer.WriteText(text); 884 clipboard_writer.WriteText(text);
881 #endif // defined(USE_X11) && !defined(OS_CHROMEOS) 885 #endif // defined(USE_X11) && !defined(OS_CHROMEOS)
882 } 886 }
883 887
884 void RenderWidgetHostViewAura::SelectionBoundsChanged( 888 void RenderWidgetHostViewAura::SelectionBoundsChanged(
885 const ViewHostMsg_SelectionBounds_Params& params) { 889 const ViewHostMsg_SelectionBounds_Params& params) {
886 if (selection_anchor_rect_ == params.anchor_rect && 890 if (selection_anchor_rect_ == params.anchor_rect &&
887 selection_focus_rect_ == params.focus_rect) 891 selection_focus_rect_ == params.focus_rect)
888 return; 892 return;
889 893
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
2286 RenderWidgetHost* widget) { 2290 RenderWidgetHost* widget) {
2287 return new RenderWidgetHostViewAura(widget); 2291 return new RenderWidgetHostViewAura(widget);
2288 } 2292 }
2289 2293
2290 // static 2294 // static
2291 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 2295 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
2292 GetScreenInfoForWindow(results, NULL); 2296 GetScreenInfoForWindow(results, NULL);
2293 } 2297 }
2294 2298
2295 } // namespace content 2299 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698