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

Side by Side Diff: ui/app_list/views/app_list_background.cc

Issue 380613002: Experimental app list: Added a current page indicator to the launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 "ui/app_list/views/app_list_background.h" 5 #include "ui/app_list/views/app_list_background.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "third_party/skia/include/core/SkPaint.h" 9 #include "third_party/skia/include/core/SkPaint.h"
10 #include "third_party/skia/include/core/SkPath.h" 10 #include "third_party/skia/include/core/SkPath.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 paint.setColor(kContentsBackgroundColor); 82 paint.setColor(kContentsBackgroundColor);
83 canvas->DrawRect(contents_rect, paint); 83 canvas->DrawRect(contents_rect, paint);
84 84
85 if (app_list::switches::IsExperimentalAppListEnabled()) { 85 if (app_list::switches::IsExperimentalAppListEnabled()) {
86 if (main_view_->visible()) { 86 if (main_view_->visible()) {
87 views::View* contents_view = main_view_->contents_view(); 87 views::View* contents_view = main_view_->contents_view();
88 const gfx::Rect contents_view_view_bounds = 88 const gfx::Rect contents_view_view_bounds =
89 contents_view->ConvertRectToWidget(contents_view->GetLocalBounds()); 89 contents_view->ConvertRectToWidget(contents_view->GetLocalBounds());
90 gfx::Rect separator_rect(contents_rect); 90 gfx::Rect separator_rect(contents_rect);
91 separator_rect.set_y(contents_view_view_bounds.bottom()); 91 // Extra 1 pixel so the launcher page indicator overlays the
92 // separator rect.
calamity 2014/07/09 05:50:18 nit: 'separator' can wrap to the previous line.
kcarattini 2014/07/09 06:45:21 Done.
93 separator_rect.set_y(contents_view_view_bounds.bottom() + 1);
92 separator_rect.set_height(kBottomSeparatorSize); 94 separator_rect.set_height(kBottomSeparatorSize);
93 canvas->FillRect(separator_rect, kBottomSeparatorColor); 95 canvas->FillRect(separator_rect, kBottomSeparatorColor);
94 int contents_switcher_top = separator_rect.bottom(); 96 int contents_switcher_top = separator_rect.bottom();
95 gfx::Rect contents_switcher_rect(bounds.x(), 97 gfx::Rect contents_switcher_rect(bounds.x(),
96 contents_switcher_top, 98 contents_switcher_top,
97 bounds.width(), 99 bounds.width(),
98 bounds.bottom() - contents_switcher_top); 100 bounds.bottom() - contents_switcher_top);
99 paint.setColor(kContentsSwitcherBackgroundColor); 101 paint.setColor(kContentsSwitcherBackgroundColor);
100 canvas->DrawRect(contents_switcher_rect, paint); 102 canvas->DrawRect(contents_switcher_rect, paint);
101 } 103 }
102 104
103 // Draw a banner in the corner of the app list if it is the experimental app 105 // Draw a banner in the corner of the app list if it is the experimental app
104 // list. 106 // list.
105 const gfx::ImageSkia& experimental_icon = 107 const gfx::ImageSkia& experimental_icon =
106 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 108 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
107 IDR_APP_LIST_EXPERIMENTAL_ICON); 109 IDR_APP_LIST_EXPERIMENTAL_ICON);
108 canvas->DrawImageInt(experimental_icon, 110 canvas->DrawImageInt(experimental_icon,
109 contents_rect.right() - experimental_icon.width(), 111 contents_rect.right() - experimental_icon.width(),
110 contents_rect.bottom() - experimental_icon.height()); 112 contents_rect.bottom() - experimental_icon.height());
111 } 113 }
112 114
113 canvas->Restore(); 115 canvas->Restore();
114 } 116 }
115 117
116 } // namespace app_list 118 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/views/contents_switcher_view.h » ('j') | ui/app_list/views/contents_switcher_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698