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

Side by Side Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view.cc

Issue 1774423002: CrOS - in pre-MD mode, paint frame correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | 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 "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/profiles/avatar_menu.h" 9 #include "chrome/browser/profiles/avatar_menu.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 : ThemeProperties::COLOR_FRAME_INACTIVE; 101 : ThemeProperties::COLOR_FRAME_INACTIVE;
102 return ShouldPaintAsThemed() ? GetThemeProvider()->GetColor(color_id) 102 return ShouldPaintAsThemed() ? GetThemeProvider()->GetColor(color_id)
103 : ThemeProperties::GetDefaultColor( 103 : ThemeProperties::GetDefaultColor(
104 color_id, browser_view_->IsOffTheRecord()); 104 color_id, browser_view_->IsOffTheRecord());
105 } 105 }
106 106
107 gfx::ImageSkia BrowserNonClientFrameView::GetFrameImage(bool active) const { 107 gfx::ImageSkia BrowserNonClientFrameView::GetFrameImage(bool active) const {
108 const ui::ThemeProvider* tp = frame_->GetThemeProvider(); 108 const ui::ThemeProvider* tp = frame_->GetThemeProvider();
109 int frame_image_id = active ? IDR_THEME_FRAME : IDR_THEME_FRAME_INACTIVE; 109 int frame_image_id = active ? IDR_THEME_FRAME : IDR_THEME_FRAME_INACTIVE;
110 110
111 if (ui::MaterialDesignController::IsModeMaterial()) { 111 // |default_uses_color| means the default frame is painted with a solid color.
112 // When false, the default frame is painted with assets.
113 #if defined(OS_CHROMEOS)
114 bool default_uses_color = true;
115 #else
116 bool default_uses_color = ui::MaterialDesignController::IsModeMaterial();
117 #endif
118 if (default_uses_color) {
112 return ShouldPaintAsThemed() && (tp->HasCustomImage(frame_image_id) || 119 return ShouldPaintAsThemed() && (tp->HasCustomImage(frame_image_id) ||
113 tp->HasCustomImage(IDR_THEME_FRAME)) 120 tp->HasCustomImage(IDR_THEME_FRAME))
114 ? *tp->GetImageSkiaNamed(frame_image_id) 121 ? *tp->GetImageSkiaNamed(frame_image_id)
115 : gfx::ImageSkia(); 122 : gfx::ImageSkia();
116 } 123 }
117 124
118 return ShouldPaintAsThemed() 125 return ShouldPaintAsThemed()
119 ? *tp->GetImageSkiaNamed(frame_image_id) 126 ? *tp->GetImageSkiaNamed(frame_image_id)
120 : *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 127 : *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
121 frame_image_id); 128 frame_image_id);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 const ProfileAttributesStorage& storage = 240 const ProfileAttributesStorage& storage =
234 g_browser_process->profile_manager()->GetProfileAttributesStorage(); 241 g_browser_process->profile_manager()->GetProfileAttributesStorage();
235 show_decoration = show_decoration && storage.GetNumberOfProfiles() > 1; 242 show_decoration = show_decoration && storage.GetNumberOfProfiles() > 1;
236 } 243 }
237 chrome::DrawTaskbarDecoration(frame_->GetNativeWindow(), 244 chrome::DrawTaskbarDecoration(frame_->GetNativeWindow(),
238 show_decoration 245 show_decoration
239 ? (taskbar_badge_avatar.IsEmpty() ? &avatar : &taskbar_badge_avatar) 246 ? (taskbar_badge_avatar.IsEmpty() ? &avatar : &taskbar_badge_avatar)
240 : nullptr); 247 : nullptr);
241 } 248 }
242 } 249 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698