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

Side by Side Diff: chrome/browser/views/page_info_bubble_view.cc

Issue 3245012: Show Page Info InfoBubble on the right side for RTL languages and make sure W... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/views/page_info_bubble_view.h" 5 #include "chrome/browser/views/page_info_bubble_view.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_list.h" 10 #include "chrome/browser/browser_list.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 namespace browser { 303 namespace browser {
304 304
305 void ShowPageInfoBubble(gfx::NativeWindow parent, 305 void ShowPageInfoBubble(gfx::NativeWindow parent,
306 Profile* profile, 306 Profile* profile,
307 const GURL& url, 307 const GURL& url,
308 const NavigationEntry::SSLStatus& ssl, 308 const NavigationEntry::SSLStatus& ssl,
309 bool show_history) { 309 bool show_history) {
310 // Find where to point the bubble at. 310 // Find where to point the bubble at.
311 BrowserView* browser_view = 311 BrowserView* browser_view =
312 BrowserView::GetBrowserViewForNativeWindow(parent); 312 BrowserView::GetBrowserViewForNativeWindow(parent);
313 gfx::Rect bounds = browser_view->toolbar()->location_bar()->bounds();
314 gfx::Point point; 313 gfx::Point point;
314 if (base::i18n::IsRTL()) {
315 int width = browser_view->toolbar()->location_bar()->width();
316 point = gfx::Point(width - kIconOffset, 0);
317 }
315 views::View::ConvertPointToScreen(browser_view->toolbar()->location_bar(), 318 views::View::ConvertPointToScreen(browser_view->toolbar()->location_bar(),
316 &point); 319 &point);
320 gfx::Rect bounds = browser_view->toolbar()->location_bar()->bounds();
317 bounds.set_origin(point); 321 bounds.set_origin(point);
318 bounds.set_width(kIconOffset); 322 bounds.set_width(kIconOffset);
319 323
320 // Show the bubble. 324 // Show the bubble.
321 PageInfoBubbleView* page_info_bubble = 325 PageInfoBubbleView* page_info_bubble =
322 new PageInfoBubbleView(parent, profile, url, ssl, show_history); 326 new PageInfoBubbleView(parent, profile, url, ssl, show_history);
323 InfoBubble* info_bubble = 327 InfoBubble* info_bubble =
324 InfoBubble::Show(browser_view->GetWidget(), bounds, 328 InfoBubble::Show(browser_view->GetWidget(), bounds,
325 BubbleBorder::TOP_LEFT, 329 BubbleBorder::TOP_LEFT,
mattm 2010/08/31 19:01:36 Oh yeah, I think this should also be TOP_RIGHT, in
326 page_info_bubble, page_info_bubble); 330 page_info_bubble, page_info_bubble);
327 page_info_bubble->set_info_bubble(info_bubble); 331 page_info_bubble->set_info_bubble(info_bubble);
328 } 332 }
329 333
330 } 334 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/page_info_window_gtk.cc ('k') | chrome/browser/views/page_info_window_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698