| 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 #ifndef CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ |
| 6 #define CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/optional.h" | 13 #include "base/optional.h" |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "chrome/browser/ui/bookmarks/bookmark_editor.h" | 16 #include "chrome/browser/ui/bookmarks/bookmark_editor.h" |
| 17 #include "third_party/skia/include/core/SkColor.h" | 17 #include "third_party/skia/include/core/SkColor.h" |
| 18 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
| 19 | 19 |
| 20 #if defined(OS_CHROMEOS) | 20 #if defined(OS_CHROMEOS) |
| 21 #include "chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.h" | 21 #include "chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.h" |
| 22 #endif // OS_CHROMEOS | 22 #endif // OS_CHROMEOS |
| 23 | 23 |
| 24 class Browser; | 24 class Browser; |
| 25 class ContentSettingBubbleModel; | |
| 26 class GURL; | 25 class GURL; |
| 27 class LoginHandler; | 26 class LoginHandler; |
| 28 class Profile; | 27 class Profile; |
| 29 | 28 |
| 30 namespace bookmarks { | |
| 31 class BookmarkBubbleObserver; | |
| 32 } | |
| 33 | |
| 34 namespace content { | 29 namespace content { |
| 35 class BrowserContext; | 30 class BrowserContext; |
| 36 class ColorChooser; | 31 class ColorChooser; |
| 37 class WebContents; | 32 class WebContents; |
| 38 } | 33 } |
| 39 | 34 |
| 40 namespace extensions { | 35 namespace extensions { |
| 41 class Extension; | 36 class Extension; |
| 42 } | 37 } |
| 43 | 38 |
| 44 namespace gfx { | 39 namespace gfx { |
| 45 class Point; | 40 class Point; |
| 46 } | 41 } |
| 47 | 42 |
| 48 namespace net { | 43 namespace net { |
| 49 class AuthChallengeInfo; | 44 class AuthChallengeInfo; |
| 50 class URLRequest; | 45 class URLRequest; |
| 51 } | 46 } |
| 52 | 47 |
| 53 namespace payments { | 48 namespace payments { |
| 54 class PaymentRequest; | 49 class PaymentRequest; |
| 55 class PaymentRequestDialog; | 50 class PaymentRequestDialog; |
| 56 } | 51 } |
| 57 | 52 |
| 58 namespace safe_browsing { | 53 namespace safe_browsing { |
| 59 class ChromeCleanerDialogController; | 54 class ChromeCleanerDialogController; |
| 60 } | 55 } |
| 61 | 56 |
| 62 namespace security_state { | |
| 63 struct SecurityInfo; | |
| 64 } // namespace security_state | |
| 65 | |
| 66 namespace task_manager { | 57 namespace task_manager { |
| 67 class TaskManagerTableModel; | 58 class TaskManagerTableModel; |
| 68 } | 59 } |
| 69 | 60 |
| 70 namespace ui { | 61 namespace ui { |
| 71 class WebDialogDelegate; | 62 class WebDialogDelegate; |
| 72 } | 63 } |
| 73 | 64 |
| 74 namespace chrome { | 65 namespace chrome { |
| 75 | 66 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 Profile* profile, | 101 Profile* profile, |
| 111 const extensions::Extension* app, | 102 const extensions::Extension* app, |
| 112 const base::Callback<void(bool /* created */)>& close_callback); | 103 const base::Callback<void(bool /* created */)>& close_callback); |
| 113 | 104 |
| 114 // Shows a color chooser that reports to the given WebContents. | 105 // Shows a color chooser that reports to the given WebContents. |
| 115 content::ColorChooser* ShowColorChooser(content::WebContents* web_contents, | 106 content::ColorChooser* ShowColorChooser(content::WebContents* web_contents, |
| 116 SkColor initial_color); | 107 SkColor initial_color); |
| 117 | 108 |
| 118 #if defined(OS_MACOSX) | 109 #if defined(OS_MACOSX) |
| 119 | 110 |
| 120 // Shows a Views page info bubble at the given anchor point. | |
| 121 void ShowPageInfoBubbleViewsAtPoint( | |
| 122 const gfx::Point& anchor_point, | |
| 123 Profile* profile, | |
| 124 content::WebContents* web_contents, | |
| 125 const GURL& virtual_url, | |
| 126 const security_state::SecurityInfo& security_info); | |
| 127 | |
| 128 // Show a Views bookmark bubble at the given point. This occurs when the | |
| 129 // bookmark star is clicked or "Bookmark This Page..." is selected from a menu | |
| 130 // or via a key equivalent. | |
| 131 void ShowBookmarkBubbleViewsAtPoint(const gfx::Point& anchor_point, | |
| 132 gfx::NativeView parent, | |
| 133 bookmarks::BookmarkBubbleObserver* observer, | |
| 134 Browser* browser, | |
| 135 const GURL& url, | |
| 136 bool newly_bookmarked); | |
| 137 | |
| 138 // Shows a views zoom bubble at the |anchor_point|. This occurs when the zoom | 111 // Shows a views zoom bubble at the |anchor_point|. This occurs when the zoom |
| 139 // icon is clicked or when a shortcut key is pressed or whenever |web_contents| | 112 // icon is clicked or when a shortcut key is pressed or whenever |web_contents| |
| 140 // zoom factor changes. |user_action| is used to determine if the bubble will | 113 // zoom factor changes. |user_action| is used to determine if the bubble will |
| 141 // auto-close. | 114 // auto-close. |
| 142 void ShowZoomBubbleViewsAtPoint(content::WebContents* web_contents, | 115 void ShowZoomBubbleViewsAtPoint(content::WebContents* web_contents, |
| 143 const gfx::Point& anchor_point, | 116 const gfx::Point& anchor_point, |
| 144 bool user_action); | 117 bool user_action); |
| 145 | 118 |
| 146 // Closes a views zoom bubble if currently shown. | 119 // Closes a views zoom bubble if currently shown. |
| 147 void CloseZoomBubbleViews(); | 120 void CloseZoomBubbleViews(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 156 |
| 184 // Shows the dialog to choose a share target app. |targets| is a list of app | 157 // Shows the dialog to choose a share target app. |targets| is a list of app |
| 185 // title and manifest URL pairs that will be shown in a list. If the user picks | 158 // title and manifest URL pairs that will be shown in a list. If the user picks |
| 186 // a target, this calls |callback| with the manifest URL of the chosen target, | 159 // a target, this calls |callback| with the manifest URL of the chosen target, |
| 187 // or supplies null if the user cancelled the share. | 160 // or supplies null if the user cancelled the share. |
| 188 void ShowWebShareTargetPickerDialog( | 161 void ShowWebShareTargetPickerDialog( |
| 189 gfx::NativeWindow parent_window, | 162 gfx::NativeWindow parent_window, |
| 190 const std::vector<std::pair<base::string16, GURL>>& targets, | 163 const std::vector<std::pair<base::string16, GURL>>& targets, |
| 191 WebShareTargetPickerCallback callback); | 164 WebShareTargetPickerCallback callback); |
| 192 | 165 |
| 193 #if defined(OS_MACOSX) | |
| 194 | |
| 195 // This is a class so that it can be friended from ContentSettingBubbleContents, | |
| 196 // which allows it to call SetAnchorRect(). | |
| 197 class ContentSettingBubbleViewsBridge { | |
| 198 public: | |
| 199 static void Show(gfx::NativeView parent_view, | |
| 200 ContentSettingBubbleModel* model, | |
| 201 content::WebContents* web_contents, | |
| 202 const gfx::Point& anchor); | |
| 203 private: | |
| 204 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingBubbleViewsBridge); | |
| 205 }; | |
| 206 | |
| 207 #endif // OS_MACOSX | |
| 208 | |
| 209 #endif // TOOLKIT_VIEWS | 166 #endif // TOOLKIT_VIEWS |
| 210 | 167 |
| 211 // Values used in the Dialog.Creation UMA metric. Each value represents a | 168 // Values used in the Dialog.Creation UMA metric. Each value represents a |
| 212 // different type of dialog box. | 169 // different type of dialog box. |
| 213 // These values are written to logs. New enum values can be added, but existing | 170 // These values are written to logs. New enum values can be added, but existing |
| 214 // enums must never be renumbered or deleted and reused. | 171 // enums must never be renumbered or deleted and reused. |
| 215 enum class DialogIdentifier { | 172 enum class DialogIdentifier { |
| 216 UNKNOWN = 0, | 173 UNKNOWN = 0, |
| 217 TRANSLATE = 1, | 174 TRANSLATE = 1, |
| 218 BOOKMARK = 2, | 175 BOOKMARK = 2, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 using BubbleShowPtr = | 284 using BubbleShowPtr = |
| 328 void (*)(content::WebContents*, | 285 void (*)(content::WebContents*, |
| 329 const std::vector<arc::ArcNavigationThrottle::AppInfo>&, | 286 const std::vector<arc::ArcNavigationThrottle::AppInfo>&, |
| 330 const IntentPickerResponse&); | 287 const IntentPickerResponse&); |
| 331 | 288 |
| 332 BubbleShowPtr ShowIntentPickerBubble(); | 289 BubbleShowPtr ShowIntentPickerBubble(); |
| 333 | 290 |
| 334 #endif // OS_CHROMEOS | 291 #endif // OS_CHROMEOS |
| 335 | 292 |
| 336 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ | 293 #endif // CHROME_BROWSER_UI_BROWSER_DIALOGS_H_ |
| OLD | NEW |