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

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: Removed static initializer. 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
« no previous file with comments | « ui/app_list/app_list_constants.cc ('k') | ui/app_list/views/app_list_main_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 (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 kContentsSwitcherSeparatorHeight pixels so the launcher page
92 // indicator overlays the separator rect.
93 separator_rect.set_y(contents_view_view_bounds.bottom() +
94 kContentsSwitcherSeparatorHeight);
92 separator_rect.set_height(kBottomSeparatorSize); 95 separator_rect.set_height(kBottomSeparatorSize);
93 canvas->FillRect(separator_rect, kBottomSeparatorColor); 96 canvas->FillRect(separator_rect, kBottomSeparatorColor);
94 int contents_switcher_top = separator_rect.bottom(); 97 int contents_switcher_top = separator_rect.bottom();
95 gfx::Rect contents_switcher_rect(bounds.x(), 98 gfx::Rect contents_switcher_rect(bounds.x(),
96 contents_switcher_top, 99 contents_switcher_top,
97 bounds.width(), 100 bounds.width(),
98 bounds.bottom() - contents_switcher_top); 101 bounds.bottom() - contents_switcher_top);
99 paint.setColor(kContentsSwitcherBackgroundColor); 102 paint.setColor(kContentsSwitcherBackgroundColor);
100 canvas->DrawRect(contents_switcher_rect, paint); 103 canvas->DrawRect(contents_switcher_rect, paint);
101 } 104 }
102 105
103 // Draw a banner in the corner of the app list if it is the experimental app 106 // Draw a banner in the corner of the app list if it is the experimental app
104 // list. 107 // list.
105 const gfx::ImageSkia& experimental_icon = 108 const gfx::ImageSkia& experimental_icon =
106 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 109 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
107 IDR_APP_LIST_EXPERIMENTAL_ICON); 110 IDR_APP_LIST_EXPERIMENTAL_ICON);
108 canvas->DrawImageInt(experimental_icon, 111 canvas->DrawImageInt(experimental_icon,
109 contents_rect.right() - experimental_icon.width(), 112 contents_rect.right() - experimental_icon.width(),
110 contents_rect.bottom() - experimental_icon.height()); 113 contents_rect.bottom() - experimental_icon.height());
111 } 114 }
112 115
113 canvas->Restore(); 116 canvas->Restore();
114 } 117 }
115 118
116 } // namespace app_list 119 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/app_list_constants.cc ('k') | ui/app_list/views/app_list_main_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698