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

Side by Side Diff: chrome/browser/ui/views/confirm_bubble_views.cc

Issue 2650583012: MacViews: Enable views based Ask Google For Suggestions dialog behind secondary-ui-md flag. (Closed)
Patch Set: Rebase. Created 3 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
« no previous file with comments | « chrome/browser/ui/cocoa/confirm_bubble_views_mac.mm ('k') | chrome/test/BUILD.gn » ('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 (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 "chrome/browser/ui/views/confirm_bubble_views.h" 5 #include "chrome/browser/ui/views/confirm_bubble_views.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "chrome/browser/ui/confirm_bubble.h" 9 #include "chrome/browser/ui/confirm_bubble.h"
10 #include "chrome/browser/ui/confirm_bubble_model.h" 10 #include "chrome/browser/ui/confirm_bubble_model.h"
11 #include "components/constrained_window/constrained_window_views.h" 11 #include "components/constrained_window/constrained_window_views.h"
12 #include "ui/base/ui_features.h"
12 #include "ui/views/controls/label.h" 13 #include "ui/views/controls/label.h"
13 #include "ui/views/controls/link.h" 14 #include "ui/views/controls/link.h"
14 #include "ui/views/layout/grid_layout.h" 15 #include "ui/views/layout/grid_layout.h"
15 #include "ui/views/layout/layout_constants.h" 16 #include "ui/views/layout/layout_constants.h"
16 #include "ui/views/widget/widget.h" 17 #include "ui/views/widget/widget.h"
17 18
18 ConfirmBubbleViews::ConfirmBubbleViews( 19 ConfirmBubbleViews::ConfirmBubbleViews(
19 std::unique_ptr<ConfirmBubbleModel> model) 20 std::unique_ptr<ConfirmBubbleModel> model)
20 : model_(std::move(model)), link_(NULL) { 21 : model_(std::move(model)), link_(NULL) {
21 views::GridLayout* layout = views::GridLayout::CreatePanel(this); 22 views::GridLayout* layout = views::GridLayout::CreatePanel(this);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 95
95 void ConfirmBubbleViews::LinkClicked(views::Link* source, int event_flags) { 96 void ConfirmBubbleViews::LinkClicked(views::Link* source, int event_flags) {
96 if (source == link_) { 97 if (source == link_) {
97 model_->LinkClicked(); 98 model_->LinkClicked();
98 GetWidget()->Close(); 99 GetWidget()->Close();
99 } 100 }
100 } 101 }
101 102
102 namespace chrome { 103 namespace chrome {
103 104
105 #if !defined(OS_MACOSX) || BUILDFLAG(MAC_VIEWS_BROWSER)
104 void ShowConfirmBubble(gfx::NativeWindow window, 106 void ShowConfirmBubble(gfx::NativeWindow window,
105 gfx::NativeView anchor_view, 107 gfx::NativeView anchor_view,
106 const gfx::Point& origin, 108 const gfx::Point& origin,
107 std::unique_ptr<ConfirmBubbleModel> model) { 109 std::unique_ptr<ConfirmBubbleModel> model) {
108 constrained_window::CreateBrowserModalDialogViews( 110 constrained_window::CreateBrowserModalDialogViews(
109 new ConfirmBubbleViews(std::move(model)), window) 111 new ConfirmBubbleViews(std::move(model)), window)
110 ->Show(); 112 ->Show();
111 } 113 }
114 #endif // !OS_MACOSX || MAC_VIEWS_BROWSER
112 115
113 } // namespace chrome 116 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/confirm_bubble_views_mac.mm ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698