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

Side by Side Diff: chrome/browser/ui/views/toolbar/browser_actions_container.cc

Issue 888043003: [Extensions Toolbar Views] Add a ToolbarActionView unittest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 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
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 "chrome/browser/ui/views/toolbar/browser_actions_container.h" 5 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "chrome/browser/extensions/tab_helper.h" 9 #include "chrome/browser/extensions/tab_helper.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 220 }
221 221
222 void BrowserActionsContainer::AddViewForAction( 222 void BrowserActionsContainer::AddViewForAction(
223 ToolbarActionViewController* view_controller, 223 ToolbarActionViewController* view_controller,
224 size_t index) { 224 size_t index) {
225 if (chevron_) 225 if (chevron_)
226 chevron_->CloseMenu(); 226 chevron_->CloseMenu();
227 227
228 view_controller->GetActionName(); 228 view_controller->GetActionName();
229 ToolbarActionView* view = 229 ToolbarActionView* view =
230 new ToolbarActionView(view_controller, browser_, this); 230 new ToolbarActionView(view_controller, browser_->profile(), this);
231 toolbar_action_views_.insert(toolbar_action_views_.begin() + index, view); 231 toolbar_action_views_.insert(toolbar_action_views_.begin() + index, view);
232 AddChildViewAt(view, index); 232 AddChildViewAt(view, index);
233 } 233 }
234 234
235 void BrowserActionsContainer::RemoveViewForAction( 235 void BrowserActionsContainer::RemoveViewForAction(
236 ToolbarActionViewController* action) { 236 ToolbarActionViewController* action) {
237 if (chevron_) 237 if (chevron_)
238 chevron_->CloseMenu(); 238 chevron_->CloseMenu();
239 239
240 for (ToolbarActionViews::iterator iter = toolbar_action_views_.begin(); 240 for (ToolbarActionViews::iterator iter = toolbar_action_views_.begin();
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 759
760 ui::ThemeProvider* tp = GetThemeProvider(); 760 ui::ThemeProvider* tp = GetThemeProvider();
761 if (tp && chevron_) { 761 if (tp && chevron_) {
762 chevron_->SetImage(views::Button::STATE_NORMAL, 762 chevron_->SetImage(views::Button::STATE_NORMAL,
763 *tp->GetImageSkiaNamed(IDR_BROWSER_ACTIONS_OVERFLOW)); 763 *tp->GetImageSkiaNamed(IDR_BROWSER_ACTIONS_OVERFLOW));
764 } 764 }
765 765
766 const int kImages[] = IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT); 766 const int kImages[] = IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT);
767 highlight_painter_.reset(views::Painter::CreateImageGridPainter(kImages)); 767 highlight_painter_.reset(views::Painter::CreateImageGridPainter(kImages));
768 } 768 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698