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

Unified Diff: chrome/browser/ui/views/extensions/chooser_dialog_view.cc

Issue 2478863003: Fix the Web Bluetooth chooser when it is used on Chrome apps on non-Mac (Closed)
Patch Set: fix the Web Bluetooth chooser when it is used on Chrome apps on non-Mac Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/extensions/chooser_dialog_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/extensions/chooser_dialog_view.cc
diff --git a/chrome/browser/ui/views/extensions/chooser_dialog_view.cc b/chrome/browser/ui/views/extensions/chooser_dialog_view.cc
index da13e010d7215e23d6e69636f4ea58295043d320..45e9878fbbf751c3c02020029d62b9c9e1875983 100644
--- a/chrome/browser/ui/views/extensions/chooser_dialog_view.cc
+++ b/chrome/browser/ui/views/extensions/chooser_dialog_view.cc
@@ -11,8 +11,12 @@
#include "components/constrained_window/constrained_window_views.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/browser_thread.h"
+#include "ui/gfx/color_palette.h"
+#include "ui/views/bubble/bubble_border.h"
+#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/link.h"
#include "ui/views/controls/styled_label.h"
+#include "ui/views/layout/layout_constants.h"
#include "ui/views/window/dialog_client_view.h"
ChooserDialogView::ChooserDialogView(
@@ -64,6 +68,32 @@ views::View* ChooserDialogView::CreateFootnoteView() {
return chooser_content_view_->CreateFootnoteView();
}
+views::ClientView* ChooserDialogView::CreateClientView(views::Widget* widget) {
+ views::DialogClientView* client =
+ new views::DialogClientView(widget, GetContentsView());
+ client->set_button_row_insets(gfx::Insets());
sky 2016/11/04 21:35:35 It would be nice not to have explicitly set this.
juncai 2016/11/05 00:34:23 The DialogDelegate::CreateClientView() doesn't cal
+ return client;
+}
+
+views::NonClientFrameView* ChooserDialogView::CreateNonClientFrameView(
+ views::Widget* widget) {
+ views::BubbleFrameView* frame = new views::BubbleFrameView(
sky 2016/11/04 21:35:35 Isn't this the same as DialogDelegate::CreateDialo
juncai 2016/11/05 00:34:23 Yes, it is the same as DialogDelegate::CreateDialo
+ gfx::Insets(views::kPanelVertMargin, views::kButtonHEdgeMarginNew, 0,
+ views::kButtonHEdgeMarginNew),
+ gfx::Insets(views::kPanelVertMargin, views::kPanelHorizMargin,
+ views::kPanelVertMargin, views::kPanelHorizMargin));
+ const views::BubbleBorder::Shadow kShadow = views::BubbleBorder::SMALL_SHADOW;
+ std::unique_ptr<views::BubbleBorder> border(new views::BubbleBorder(
+ views::BubbleBorder::FLOAT, kShadow, gfx::kPlaceholderColor));
+ border->set_use_theme_background_color(true);
+ frame->SetBubbleBorder(std::move(border));
+ views::DialogDelegate* delegate =
+ widget->widget_delegate()->AsDialogDelegate();
+ if (delegate)
+ frame->SetFootnoteView(delegate->CreateFootnoteView());
+ return frame;
+}
+
bool ChooserDialogView::Accept() {
chooser_content_view_->Accept();
return true;
« no previous file with comments | « chrome/browser/ui/views/extensions/chooser_dialog_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698