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

Side by Side Diff: chrome/browser/ui/views/status_bubble_views.cc

Issue 2897533003: Change default ink drop center points to center of contents bounds (Closed)
Patch Set: fix compile Created 3 years, 6 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/status_bubble_views.h" 5 #include "chrome/browser/ui/views/status_bubble_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 canvas->sk_canvas()->drawPath(stroke_path, flags); 477 canvas->sk_canvas()->drawPath(stroke_path, flags);
478 478
479 canvas->Restore(); 479 canvas->Restore();
480 480
481 // Compute text bounds. 481 // Compute text bounds.
482 gfx::Rect text_rect(kTextPositionX, 0, 482 gfx::Rect text_rect(kTextPositionX, 0,
483 popup_size_.width() - kTextHorizPadding, 483 popup_size_.width() - kTextHorizPadding,
484 popup_size_.height()); 484 popup_size_.height());
485 text_rect.Inset(kShadowThickness, kShadowThickness); 485 text_rect.Inset(kShadowThickness, kShadowThickness);
486 // Make sure the text is aligned to the right on RTL UIs. 486 // Make sure the text is aligned to the right on RTL UIs.
487 text_rect.set_x(GetMirroredXForRect(text_rect)); 487 text_rect = GetMirroredRect(text_rect);
488 488
489 // Text color is the foreground tab text color at 60% alpha. 489 // Text color is the foreground tab text color at 60% alpha.
490 SkColor blended_text_color = color_utils::AlphaBlend( 490 SkColor blended_text_color = color_utils::AlphaBlend(
491 theme_provider_->GetColor(ThemeProperties::COLOR_TAB_TEXT), bubble_color, 491 theme_provider_->GetColor(ThemeProperties::COLOR_TAB_TEXT), bubble_color,
492 0x99); 492 0x99);
493 canvas->DrawStringRect( 493 canvas->DrawStringRect(
494 text_, gfx::FontList(), 494 text_, gfx::FontList(),
495 color_utils::GetReadableColor(blended_text_color, bubble_color), 495 color_utils::GetReadableColor(blended_text_color, bubble_color),
496 text_rect); 496 text_rect);
497 } 497 }
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 void StatusBubbleViews::SetBubbleWidth(int width) { 949 void StatusBubbleViews::SetBubbleWidth(int width) {
950 size_.set_width(width); 950 size_.set_width(width);
951 SetBounds(original_position_.x(), original_position_.y(), 951 SetBounds(original_position_.x(), original_position_.y(),
952 size_.width(), size_.height()); 952 size_.width(), size_.height());
953 } 953 }
954 954
955 void StatusBubbleViews::CancelExpandTimer() { 955 void StatusBubbleViews::CancelExpandTimer() {
956 if (expand_timer_factory_.HasWeakPtrs()) 956 if (expand_timer_factory_.HasWeakPtrs())
957 expand_timer_factory_.InvalidateWeakPtrs(); 957 expand_timer_factory_.InvalidateWeakPtrs();
958 } 958 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/opaque_browser_frame_view.cc ('k') | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698