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

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

Issue 1004063003: [Extensions] Add logic for when to show the toolbar redesign bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/extensions/extension_toolbar_icon_surfacing_bu bble_views.h" 5 #include "chrome/browser/ui/views/extensions/extension_toolbar_icon_surfacing_bu bble_views.h"
6 6
7 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" 7 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h"
8 #include "grit/chromium_strings.h" 8 #include "grit/chromium_strings.h"
9 #include "grit/generated_resources.h" 9 #include "grit/generated_resources.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
11 #include "ui/base/resource/resource_bundle.h" 11 #include "ui/base/resource/resource_bundle.h"
12 #include "ui/views/controls/button/label_button.h" 12 #include "ui/views/controls/button/label_button.h"
13 #include "ui/views/controls/label.h" 13 #include "ui/views/controls/label.h"
14 #include "ui/views/layout/grid_layout.h" 14 #include "ui/views/layout/grid_layout.h"
15 15
16 ExtensionToolbarIconSurfacingBubble::ExtensionToolbarIconSurfacingBubble( 16 ExtensionToolbarIconSurfacingBubble::ExtensionToolbarIconSurfacingBubble(
17 views::View* anchor_view, 17 views::View* anchor_view,
18 ToolbarActionsBarBubbleDelegate* delegate) 18 ToolbarActionsBarBubbleDelegate* delegate)
19 : views::BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), 19 : views::BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT),
20 delegate_(delegate), 20 delegate_(delegate),
21 acknowledged_(false) { 21 acknowledged_(false) {
22 delegate_->OnToolbarActionsBarBubbleShown();
22 } 23 }
23 24
24 ExtensionToolbarIconSurfacingBubble::~ExtensionToolbarIconSurfacingBubble() { 25 ExtensionToolbarIconSurfacingBubble::~ExtensionToolbarIconSurfacingBubble() {
25 } 26 }
26 27
27 void ExtensionToolbarIconSurfacingBubble::Init() { 28 void ExtensionToolbarIconSurfacingBubble::Init() {
28 views::GridLayout* layout = new views::GridLayout(this); 29 views::GridLayout* layout = new views::GridLayout(this);
29 SetLayoutManager(layout); 30 SetLayoutManager(layout);
30 // Initialize a basic column set of |<padding> <content> <padding>|. 31 // Initialize a basic column set of |<padding> <content> <padding>|.
31 views::ColumnSet* columns = layout->AddColumnSet(0); 32 views::ColumnSet* columns = layout->AddColumnSet(0);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 84 }
84 85
85 void ExtensionToolbarIconSurfacingBubble::ButtonPressed( 86 void ExtensionToolbarIconSurfacingBubble::ButtonPressed(
86 views::Button* sender, 87 views::Button* sender,
87 const ui::Event& event) { 88 const ui::Event& event) {
88 delegate_->OnToolbarActionsBarBubbleClosed( 89 delegate_->OnToolbarActionsBarBubbleClosed(
89 ToolbarActionsBarBubbleDelegate::ACKNOWLEDGED); 90 ToolbarActionsBarBubbleDelegate::ACKNOWLEDGED);
90 acknowledged_ = true; 91 acknowledged_ = true;
91 GetWidget()->Close(); 92 GetWidget()->Close();
92 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698