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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc

Issue 1950863002: [Views] Center bubble title text vertically when title icon is tall. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | ui/views/bubble/bubble_frame_view.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/metrics/user_metrics_action.h" 10 #include "base/metrics/user_metrics_action.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 int ExtensionInstalledBubbleView::GetDialogButtons() const { 212 int ExtensionInstalledBubbleView::GetDialogButtons() const {
213 return ui::DIALOG_BUTTON_NONE; 213 return ui::DIALOG_BUTTON_NONE;
214 } 214 }
215 215
216 bool ExtensionInstalledBubbleView::ShouldShowCloseButton() const { 216 bool ExtensionInstalledBubbleView::ShouldShowCloseButton() const {
217 return true; 217 return true;
218 } 218 }
219 219
220 void ExtensionInstalledBubbleView::Init() { 220 void ExtensionInstalledBubbleView::Init() {
221 gfx::Insets insets = margins();
222 UpdateAnchorView(); 221 UpdateAnchorView();
223 222
224 // The Extension Installed bubble takes on various forms, depending on the 223 // The Extension Installed bubble takes on various forms, depending on the
225 // type of extension installed. In general, though, they are all similar: 224 // type of extension installed. In general, though, they are all similar:
226 // 225 //
227 // ------------------------- 226 // -------------------------
228 // | Icon | Title (x) | 227 // | Icon | Title (x) |
229 // | Info | 228 // | Info |
230 // | Extra info | 229 // | Extra info |
231 // ------------------------- 230 // -------------------------
232 // 231 //
233 // Icon and Title are always shown (as well as the close button). 232 // Icon and Title are always shown (as well as the close button).
234 // Info is shown for browser actions, page actions and Omnibox keyword 233 // Info is shown for browser actions, page actions and Omnibox keyword
235 // extensions and might list keyboard shorcut for the former two types. 234 // extensions and might list keyboard shorcut for the former two types.
236 // Extra info is... 235 // Extra info is...
237 // ... for other types, either a description of how to manage the extension 236 // ... for other types, either a description of how to manage the extension
238 // or a link to configure the keybinding shortcut (if one exists). 237 // or a link to configure the keybinding shortcut (if one exists).
239 // Extra info can include a promo for signing into sync. 238 // Extra info can include a promo for signing into sync.
240 239
241 // Move explanatory text closer to the title.
Evan Stade 2016/05/04 01:35:29 this was previously necessary because the title te
242 set_margins(gfx::Insets(0, insets.left(), insets.bottom(), insets.right()));
243
244 std::unique_ptr<views::BoxLayout> layout( 240 std::unique_ptr<views::BoxLayout> layout(
245 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 241 new views::BoxLayout(views::BoxLayout::kVertical, 0, 0,
246 views::kRelatedControlVerticalSpacing)); 242 views::kRelatedControlVerticalSpacing));
247 // Indent by the size of the icon. 243 // Indent by the size of the icon.
248 layout->set_inside_border_insets(gfx::Insets( 244 layout->set_inside_border_insets(gfx::Insets(
249 0, GetIconSize().width() + views::kUnrelatedControlHorizontalSpacing, 0, 245 0, GetIconSize().width() + views::kUnrelatedControlHorizontalSpacing, 0,
250 0)); 246 0));
251 SetLayoutManager(layout.release()); 247 SetLayoutManager(layout.release());
252 248
253 if (controller_->options() & ExtensionInstalledBubble::HOW_TO_USE) 249 if (controller_->options() & ExtensionInstalledBubble::HOW_TO_USE)
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 ->browser_actions(); 360 ->browser_actions();
365 return !container->animating(); 361 return !container->animating();
366 } 362 }
367 return true; 363 return true;
368 } 364 }
369 365
370 // Implemented here to create the platform specific instance of the BubbleUi. 366 // Implemented here to create the platform specific instance of the BubbleUi.
371 std::unique_ptr<BubbleUi> ExtensionInstalledBubble::BuildBubbleUi() { 367 std::unique_ptr<BubbleUi> ExtensionInstalledBubble::BuildBubbleUi() {
372 return base::WrapUnique(new ExtensionInstalledBubbleUi(this)); 368 return base::WrapUnique(new ExtensionInstalledBubbleUi(this));
373 } 369 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/bubble/bubble_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698