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

Side by Side Diff: athena/content/web_contents_view_delegate_factory_impl.cc

Issue 641683003: C++11 override style change for athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebase Created 6 years, 2 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 | « athena/content/web_activity.cc ('k') | athena/env/athena_env_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "athena/content/public/web_contents_view_delegate_creator.h" 5 #include "athena/content/public/web_contents_view_delegate_creator.h"
6 6
7 #include "athena/content/render_view_context_menu_impl.h" 7 #include "athena/content/render_view_context_menu_impl.h"
8 #include "components/web_modal/popup_manager.h" 8 #include "components/web_modal/popup_manager.h"
9 #include "components/web_modal/single_web_contents_dialog_manager.h" 9 #include "components/web_modal/single_web_contents_dialog_manager.h"
10 #include "components/web_modal/web_contents_modal_dialog_host.h" 10 #include "components/web_modal/web_contents_modal_dialog_host.h"
11 #include "components/web_modal/web_contents_modal_dialog_manager.h" 11 #include "components/web_modal/web_contents_modal_dialog_manager.h"
12 #include "content/public/browser/render_widget_host_view.h" 12 #include "content/public/browser/render_widget_host_view.h"
13 #include "content/public/browser/web_contents.h" 13 #include "content/public/browser/web_contents.h"
14 #include "content/public/browser/web_contents_delegate.h" 14 #include "content/public/browser/web_contents_delegate.h"
15 #include "content/public/browser/web_contents_view_delegate.h" 15 #include "content/public/browser/web_contents_view_delegate.h"
16 #include "ui/aura/client/screen_position_client.h" 16 #include "ui/aura/client/screen_position_client.h"
17 #include "ui/aura/window.h" 17 #include "ui/aura/window.h"
18 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
19 19
20 namespace athena { 20 namespace athena {
21 namespace { 21 namespace {
22 22
23 class WebContentsViewDelegateImpl : public content::WebContentsViewDelegate { 23 class WebContentsViewDelegateImpl : public content::WebContentsViewDelegate {
24 public: 24 public:
25 explicit WebContentsViewDelegateImpl(content::WebContents* web_contents) 25 explicit WebContentsViewDelegateImpl(content::WebContents* web_contents)
26 : web_contents_(web_contents) {} 26 : web_contents_(web_contents) {}
27 virtual ~WebContentsViewDelegateImpl() {} 27 ~WebContentsViewDelegateImpl() override {}
28 28
29 virtual content::WebDragDestDelegate* GetDragDestDelegate() override { 29 content::WebDragDestDelegate* GetDragDestDelegate() override {
30 // TODO(oshima): crbug.com/401610 30 // TODO(oshima): crbug.com/401610
31 NOTIMPLEMENTED(); 31 NOTIMPLEMENTED();
32 return nullptr; 32 return nullptr;
33 } 33 }
34 34
35 virtual bool Focus() override { 35 bool Focus() override {
36 web_modal::PopupManager* popup_manager = 36 web_modal::PopupManager* popup_manager =
37 web_modal::PopupManager::FromWebContents(web_contents_); 37 web_modal::PopupManager::FromWebContents(web_contents_);
38 if (popup_manager) 38 if (popup_manager)
39 popup_manager->WasFocused(web_contents_); 39 popup_manager->WasFocused(web_contents_);
40 return false; 40 return false;
41 } 41 }
42 42
43 virtual void ShowContextMenu( 43 void ShowContextMenu(content::RenderFrameHost* render_frame_host,
44 content::RenderFrameHost* render_frame_host, 44 const content::ContextMenuParams& params) override {
45 const content::ContextMenuParams& params) override {
46 ShowMenu(BuildMenu( 45 ShowMenu(BuildMenu(
47 content::WebContents::FromRenderFrameHost(render_frame_host), params)); 46 content::WebContents::FromRenderFrameHost(render_frame_host), params));
48 } 47 }
49 48
50 virtual void SizeChanged(const gfx::Size& size) override { 49 void SizeChanged(const gfx::Size& size) override {
51 // TODO(oshima|sadrul): Implement this when sad_tab is componentized. 50 // TODO(oshima|sadrul): Implement this when sad_tab is componentized.
52 // See c/b/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc 51 // See c/b/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc
53 } 52 }
54 53
55 virtual void ShowDisambiguationPopup( 54 void ShowDisambiguationPopup(
56 const gfx::Rect& target_rect, 55 const gfx::Rect& target_rect,
57 const SkBitmap& zoomed_bitmap, 56 const SkBitmap& zoomed_bitmap,
58 const gfx::NativeView content, 57 const gfx::NativeView content,
59 const base::Callback<void(ui::GestureEvent*)>& gesture_cb, 58 const base::Callback<void(ui::GestureEvent*)>& gesture_cb,
60 const base::Callback<void(ui::MouseEvent*)>& mouse_cb) override { 59 const base::Callback<void(ui::MouseEvent*)>& mouse_cb) override {
61 NOTIMPLEMENTED(); 60 NOTIMPLEMENTED();
62 } 61 }
63 62
64 virtual void HideDisambiguationPopup() override { NOTIMPLEMENTED(); } 63 void HideDisambiguationPopup() override { NOTIMPLEMENTED(); }
65 64
66 scoped_ptr<RenderViewContextMenuImpl> BuildMenu( 65 scoped_ptr<RenderViewContextMenuImpl> BuildMenu(
67 content::WebContents* web_contents, 66 content::WebContents* web_contents,
68 const content::ContextMenuParams& params) { 67 const content::ContextMenuParams& params) {
69 scoped_ptr<RenderViewContextMenuImpl> menu; 68 scoped_ptr<RenderViewContextMenuImpl> menu;
70 content::RenderFrameHost* focused_frame = web_contents->GetFocusedFrame(); 69 content::RenderFrameHost* focused_frame = web_contents->GetFocusedFrame();
71 // If the frame tree does not have a focused frame at this point, do not 70 // If the frame tree does not have a focused frame at this point, do not
72 // bother creating RenderViewContextMenuViews. 71 // bother creating RenderViewContextMenuViews.
73 // This happens if the frame has navigated to a different page before 72 // This happens if the frame has navigated to a different page before
74 // ContextMenu message was received by the current RenderFrameHost. 73 // ContextMenu message was received by the current RenderFrameHost.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 }; 144 };
146 145
147 } // namespace 146 } // namespace
148 147
149 content::WebContentsViewDelegate* CreateWebContentsViewDelegate( 148 content::WebContentsViewDelegate* CreateWebContentsViewDelegate(
150 content::WebContents* web_contents) { 149 content::WebContents* web_contents) {
151 return new WebContentsViewDelegateImpl(web_contents); 150 return new WebContentsViewDelegateImpl(web_contents);
152 } 151 }
153 152
154 } // namespace athena 153 } // namespace athena
OLDNEW
« no previous file with comments | « athena/content/web_activity.cc ('k') | athena/env/athena_env_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698