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_browsert
est_util.h" | 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu_browsert
est_util.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 base::Unretained(this), | 74 base::Unretained(this), |
75 context_menu)); | 75 context_menu)); |
76 break; | 76 break; |
77 } | 77 } |
78 | 78 |
79 default: | 79 default: |
80 NOTREACHED(); | 80 NOTREACHED(); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 void SaveLinkAsContextMenuObserver::WaitForMenu() { | 84 void SaveLinkAsContextMenuObserver::WaitForMenuOpenAndClose() { |
85 content::WindowedNotificationObserver menu_observer( | 85 content::WindowedNotificationObserver menu_observer( |
86 chrome::NOTIFICATION_RENDER_VIEW_CONTEXT_MENU_SHOWN, | 86 chrome::NOTIFICATION_RENDER_VIEW_CONTEXT_MENU_SHOWN, |
87 content::NotificationService::AllSources()); | 87 content::NotificationService::AllSources()); |
88 if (!menu_visible_) | 88 if (!menu_visible_) |
89 menu_observer.Wait(); | 89 menu_observer.Wait(); |
90 menu_visible_ = false; | 90 menu_visible_ = false; |
91 } | 91 } |
92 | 92 |
93 base::string16 SaveLinkAsContextMenuObserver::GetSuggestedFilename() { | 93 content::ContextMenuParams& SaveLinkAsContextMenuObserver::params() { |
94 return params_.suggested_filename; | 94 return params_; |
95 } | 95 } |
96 | 96 |
97 void SaveLinkAsContextMenuObserver::Cancel( | 97 void SaveLinkAsContextMenuObserver::Cancel( |
98 RenderViewContextMenu* context_menu) { | 98 RenderViewContextMenu* context_menu) { |
99 params_ = context_menu->params(); | 99 params_ = context_menu->params(); |
100 context_menu->Cancel(); | 100 context_menu->Cancel(); |
101 } | 101 } |
OLD | NEW |