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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc

Issue 614103007: Error in popup on Link (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review Created 6 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/extension_installed_bubble_view.h" 5 #include "chrome/browser/ui/views/extensions/extension_installed_bubble_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 base::string16 full_text = signin_promo_link_text_ + signin_promo_text_; 332 base::string16 full_text = signin_promo_link_text_ + signin_promo_text_;
333 333
334 // The link is the first item in the text. 334 // The link is the first item in the text.
335 const gfx::Size link_size = sign_in_link_->GetPreferredSize(); 335 const gfx::Size link_size = sign_in_link_->GetPreferredSize();
336 sign_in_link_->SetBounds( 336 sign_in_link_->SetBounds(
337 offset_x, offset_y, link_size.width(), link_size.height()); 337 offset_x, offset_y, link_size.width(), link_size.height());
338 338
339 // Word-wrap the full label text. 339 // Word-wrap the full label text.
340 const gfx::FontList font_list; 340 const gfx::FontList font_list;
341 std::vector<base::string16> lines; 341 std::vector<base::string16> lines;
342 gfx::ElideRectangleText(full_text, font_list, contents_area.width(), 342 gfx::ElideRectangleText(full_text,
343 contents_area.height(), gfx::ELIDE_LONG_WORDS, 343 font_list,
344 &lines); 344 contents_area.width(),
345 contents_area.height(),
346 gfx::ELIDE_LONG_WORDS,
347 &lines,
348 nullptr);
345 349
346 gfx::Point position = gfx::Point( 350 gfx::Point position = gfx::Point(
347 contents_area.origin().x() + offset_x, 351 contents_area.origin().x() + offset_x,
348 contents_area.origin().y() + offset_y + 1); 352 contents_area.origin().y() + offset_y + 1);
349 if (base::i18n::IsRTL()) { 353 if (base::i18n::IsRTL()) {
350 position -= gfx::Vector2d( 354 position -= gfx::Vector2d(
351 2 * views::kPanelHorizMargin + kHorizOuterMargin, 0); 355 2 * views::kPanelHorizMargin + kHorizOuterMargin, 0);
352 } 356 }
353 357
354 // Loop through the lines, creating a renderer for each. 358 // Loop through the lines, creating a renderer for each.
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 void ExtensionInstalledBubbleView::WindowClosing() { 601 void ExtensionInstalledBubbleView::WindowClosing() {
598 if (bubble_.extension() && bubble_.type() == bubble_.PAGE_ACTION) { 602 if (bubble_.extension() && bubble_.type() == bubble_.PAGE_ACTION) {
599 BrowserView* browser_view = 603 BrowserView* browser_view =
600 BrowserView::GetBrowserViewForBrowser(bubble_.browser()); 604 BrowserView::GetBrowserViewForBrowser(bubble_.browser());
601 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( 605 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction(
602 extensions::ExtensionActionManager::Get(bubble_.browser()->profile())-> 606 extensions::ExtensionActionManager::Get(bubble_.browser()->profile())->
603 GetPageAction(*bubble_.extension()), 607 GetPageAction(*bubble_.extension()),
604 false); // preview_enabled 608 false); // preview_enabled
605 } 609 }
606 } 610 }
OLDNEW
« no previous file with comments | « ash/system/user/user_card_view.cc ('k') | ui/gfx/canvas_skia.cc » ('j') | ui/gfx/canvas_skia.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698