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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 1053143002: Make View::Paint use ui::PaintRecorder to access PaintContext's canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: paintrecorder: . Created 5 years, 8 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 (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/bookmarks/bookmark_bar_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #include "extensions/common/extension_set.h" 65 #include "extensions/common/extension_set.h"
66 #include "grit/theme_resources.h" 66 #include "grit/theme_resources.h"
67 #include "ui/accessibility/ax_view_state.h" 67 #include "ui/accessibility/ax_view_state.h"
68 #include "ui/base/dragdrop/drag_utils.h" 68 #include "ui/base/dragdrop/drag_utils.h"
69 #include "ui/base/dragdrop/os_exchange_data.h" 69 #include "ui/base/dragdrop/os_exchange_data.h"
70 #include "ui/base/l10n/l10n_util.h" 70 #include "ui/base/l10n/l10n_util.h"
71 #include "ui/base/page_transition_types.h" 71 #include "ui/base/page_transition_types.h"
72 #include "ui/base/resource/resource_bundle.h" 72 #include "ui/base/resource/resource_bundle.h"
73 #include "ui/base/theme_provider.h" 73 #include "ui/base/theme_provider.h"
74 #include "ui/base/window_open_disposition.h" 74 #include "ui/base/window_open_disposition.h"
75 #include "ui/compositor/paint_context.h"
75 #include "ui/gfx/animation/slide_animation.h" 76 #include "ui/gfx/animation/slide_animation.h"
76 #include "ui/gfx/canvas.h" 77 #include "ui/gfx/canvas.h"
77 #include "ui/gfx/text_constants.h" 78 #include "ui/gfx/text_constants.h"
78 #include "ui/gfx/text_elider.h" 79 #include "ui/gfx/text_elider.h"
79 #include "ui/resources/grit/ui_resources.h" 80 #include "ui/resources/grit/ui_resources.h"
80 #include "ui/views/button_drag_utils.h" 81 #include "ui/views/button_drag_utils.h"
81 #include "ui/views/controls/button/label_button.h" 82 #include "ui/views/controls/button/label_button.h"
82 #include "ui/views/controls/button/label_button_border.h" 83 #include "ui/views/controls/button/label_button_border.h"
83 #include "ui/views/controls/button/menu_button.h" 84 #include "ui/views/controls/button/menu_button.h"
84 #include "ui/views/controls/label.h" 85 #include "ui/views/controls/label.h"
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 969
969 if (height() > 0) { 970 if (height() > 0) {
970 // We only layout while parented. When we become parented, if our bounds 971 // We only layout while parented. When we become parented, if our bounds
971 // haven't changed, OnBoundsChanged() won't get invoked and we won't 972 // haven't changed, OnBoundsChanged() won't get invoked and we won't
972 // layout. Therefore we always force a layout when added. 973 // layout. Therefore we always force a layout when added.
973 Layout(); 974 Layout();
974 } 975 }
975 } 976 }
976 } 977 }
977 978
978 void BookmarkBarView::PaintChildren(const PaintContext& context) { 979 void BookmarkBarView::PaintChildren(const ui::PaintContext& context) {
979 View::PaintChildren(context); 980 View::PaintChildren(context);
980 981
981 if (drop_info_.get() && drop_info_->valid && 982 if (drop_info_.get() && drop_info_->valid &&
982 drop_info_->location.operation != 0 && drop_info_->location.index != -1 && 983 drop_info_->location.operation != 0 && drop_info_->location.index != -1 &&
983 drop_info_->location.button_type != DROP_OVERFLOW && 984 drop_info_->location.button_type != DROP_OVERFLOW &&
984 !drop_info_->location.on) { 985 !drop_info_->location.on) {
985 int index = drop_info_->location.index; 986 int index = drop_info_->location.index;
986 DCHECK(index <= GetBookmarkButtonCount()); 987 DCHECK(index <= GetBookmarkButtonCount());
987 int x = 0; 988 int x = 0;
988 int y = 0; 989 int y = 0;
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 return; 2072 return;
2072 apps_page_shortcut_->SetVisible(visible); 2073 apps_page_shortcut_->SetVisible(visible);
2073 UpdateBookmarksSeparatorVisibility(); 2074 UpdateBookmarksSeparatorVisibility();
2074 LayoutAndPaint(); 2075 LayoutAndPaint();
2075 } 2076 }
2076 2077
2077 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { 2078 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() {
2078 if (UpdateOtherAndManagedButtonsVisibility()) 2079 if (UpdateOtherAndManagedButtonsVisibility())
2079 LayoutAndPaint(); 2080 LayoutAndPaint();
2080 } 2081 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698