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

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

Issue 23731010: Move text_elider to gfx. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update3 Created 7 years, 3 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 | Annotate | Revision Log
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 17 matching lines...) Expand all
28 #include "chrome/browser/ui/views/toolbar_view.h" 28 #include "chrome/browser/ui/views/toolbar_view.h"
29 #include "chrome/common/extensions/api/omnibox/omnibox_handler.h" 29 #include "chrome/common/extensions/api/omnibox/omnibox_handler.h"
30 #include "chrome/common/extensions/extension.h" 30 #include "chrome/common/extensions/extension.h"
31 #include "chrome/common/extensions/sync_helper.h" 31 #include "chrome/common/extensions/sync_helper.h"
32 #include "chrome/common/url_constants.h" 32 #include "chrome/common/url_constants.h"
33 #include "grit/chromium_strings.h" 33 #include "grit/chromium_strings.h"
34 #include "grit/generated_resources.h" 34 #include "grit/generated_resources.h"
35 #include "grit/ui_resources.h" 35 #include "grit/ui_resources.h"
36 #include "ui/base/l10n/l10n_util.h" 36 #include "ui/base/l10n/l10n_util.h"
37 #include "ui/base/resource/resource_bundle.h" 37 #include "ui/base/resource/resource_bundle.h"
38 #include "ui/base/text/text_elider.h"
39 #include "ui/gfx/render_text.h" 38 #include "ui/gfx/render_text.h"
39 #include "ui/gfx/text_elider.h"
40 #include "ui/views/controls/button/image_button.h" 40 #include "ui/views/controls/button/image_button.h"
41 #include "ui/views/controls/image_view.h" 41 #include "ui/views/controls/image_view.h"
42 #include "ui/views/controls/label.h" 42 #include "ui/views/controls/label.h"
43 #include "ui/views/controls/link.h" 43 #include "ui/views/controls/link.h"
44 #include "ui/views/controls/link_listener.h" 44 #include "ui/views/controls/link_listener.h"
45 #include "ui/views/layout/fill_layout.h" 45 #include "ui/views/layout/fill_layout.h"
46 #include "ui/views/layout/layout_constants.h" 46 #include "ui/views/layout/layout_constants.h"
47 47
48 using extensions::Extension; 48 using extensions::Extension;
49 49
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 string16 full_text = signin_promo_link_text_ + signin_promo_text_; 336 string16 full_text = signin_promo_link_text_ + signin_promo_text_;
337 337
338 // The link is the first item in the text. 338 // The link is the first item in the text.
339 const gfx::Size link_size = sign_in_link_->GetPreferredSize(); 339 const gfx::Size link_size = sign_in_link_->GetPreferredSize();
340 sign_in_link_->SetBounds( 340 sign_in_link_->SetBounds(
341 offset_x, offset_y, link_size.width(), link_size.height()); 341 offset_x, offset_y, link_size.width(), link_size.height());
342 342
343 // Word-wrap the full label text. 343 // Word-wrap the full label text.
344 const gfx::Font font; 344 const gfx::Font font;
345 std::vector<string16> lines; 345 std::vector<string16> lines;
346 ui::ElideRectangleText(full_text, font, contents_area.width(), 346 gfx::ElideRectangleText(full_text, font, contents_area.width(),
347 contents_area.height(), ui::ELIDE_LONG_WORDS, 347 contents_area.height(), gfx::ELIDE_LONG_WORDS,
348 &lines); 348 &lines);
349 349
350 gfx::Point position = gfx::Point( 350 gfx::Point position = gfx::Point(
351 contents_area.origin().x() + offset_x, 351 contents_area.origin().x() + offset_x,
352 contents_area.origin().y() + offset_y + 1); 352 contents_area.origin().y() + offset_y + 1);
353 if (base::i18n::IsRTL()) { 353 if (base::i18n::IsRTL()) {
354 position -= gfx::Vector2d( 354 position -= gfx::Vector2d(
355 2 * views::kPanelHorizMargin + kHorizOuterMargin, 0); 355 2 * views::kPanelHorizMargin + kHorizOuterMargin, 0);
356 } 356 }
357 357
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 void ExtensionInstalledBubbleView::WindowClosing() { 607 void ExtensionInstalledBubbleView::WindowClosing() {
608 if (bubble_.extension() && bubble_.type() == bubble_.PAGE_ACTION) { 608 if (bubble_.extension() && bubble_.type() == bubble_.PAGE_ACTION) {
609 BrowserView* browser_view = 609 BrowserView* browser_view =
610 BrowserView::GetBrowserViewForBrowser(bubble_.browser()); 610 BrowserView::GetBrowserViewForBrowser(bubble_.browser());
611 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( 611 browser_view->GetLocationBarView()->SetPreviewEnabledPageAction(
612 extensions::ExtensionActionManager::Get(bubble_.browser()->profile())-> 612 extensions::ExtensionActionManager::Get(bubble_.browser()->profile())->
613 GetPageAction(*bubble_.extension()), 613 GetPageAction(*bubble_.extension()),
614 false); // preview_enabled 614 false); // preview_enabled
615 } 615 }
616 } 616 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view.cc ('k') | chrome/browser/ui/views/external_protocol_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698