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

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

Issue 1518543002: Adds MD ink ripple animations to buttons within location bar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds MD ink ripple animations to buttons within location bar (reverted a bad change) Created 4 years, 10 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 } 1281 }
1282 1282
1283 void BrowserView::ShowUpdateChromeDialog() { 1283 void BrowserView::ShowUpdateChromeDialog() {
1284 UpdateRecommendedMessageBox::Show(GetWidget()->GetNativeWindow()); 1284 UpdateRecommendedMessageBox::Show(GetWidget()->GetNativeWindow());
1285 } 1285 }
1286 1286
1287 void BrowserView::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) { 1287 void BrowserView::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) {
1288 scoped_ptr<BubbleSyncPromoDelegate> delegate; 1288 scoped_ptr<BubbleSyncPromoDelegate> delegate;
1289 delegate.reset(new BookmarkBubbleSignInDelegate(browser_.get())); 1289 delegate.reset(new BookmarkBubbleSignInDelegate(browser_.get()));
1290 1290
1291 BookmarkBubbleView::ShowBubble(GetToolbarView()->GetBookmarkBubbleAnchor(), 1291 views::WidgetObserverView* anchor_view =
1292 GetToolbarView()->GetBookmarkBubbleAnchor();
1293 BookmarkBubbleView::ShowBubble(anchor_view,
1292 gfx::Rect(), nullptr, bookmark_bar_view_.get(), 1294 gfx::Rect(), nullptr, bookmark_bar_view_.get(),
1293 std::move(delegate), browser_->profile(), url, 1295 std::move(delegate), browser_->profile(), url,
1294 already_bookmarked); 1296 already_bookmarked);
1297 anchor_view->ObserveWidget(
1298 BookmarkBubbleView::bookmark_bubble()->GetWidget());
sadrul 2016/01/28 17:45:06 I would do this differently: . BubbleIconView bec
varkha 2016/01/28 20:09:19 Yes, this is precisely what I was looking for. Tha
1295 } 1299 }
1296 1300
1297 void BrowserView::ShowBookmarkAppBubble( 1301 void BrowserView::ShowBookmarkAppBubble(
1298 const WebApplicationInfo& web_app_info, 1302 const WebApplicationInfo& web_app_info,
1299 const ShowBookmarkAppBubbleCallback& callback) { 1303 const ShowBookmarkAppBubbleCallback& callback) {
1300 BookmarkAppBubbleView::ShowBubble(GetToolbarView(), web_app_info, callback); 1304 BookmarkAppBubbleView::ShowBubble(GetToolbarView(), web_app_info, callback);
1301 } 1305 }
1302 1306
1303 autofill::SaveCardBubbleView* BrowserView::ShowSaveCreditCardBubble( 1307 autofill::SaveCardBubbleView* BrowserView::ShowSaveCreditCardBubble(
1304 content::WebContents* web_contents, 1308 content::WebContents* web_contents,
1305 autofill::SaveCardBubbleController* controller, 1309 autofill::SaveCardBubbleController* controller,
1306 bool is_user_gesture) { 1310 bool is_user_gesture) {
1311 views::WidgetObserverView* anchor_view =
1312 GetToolbarView()->GetSaveCreditCardBubbleAnchor();
1307 autofill::SaveCardBubbleViews* view = new autofill::SaveCardBubbleViews( 1313 autofill::SaveCardBubbleViews* view = new autofill::SaveCardBubbleViews(
1308 GetToolbarView()->GetSaveCreditCardBubbleAnchor(), web_contents, 1314 anchor_view, web_contents,
1309 controller); 1315 controller);
1316 anchor_view->ObserveWidget(view->GetWidget());
1310 view->Show(is_user_gesture ? autofill::SaveCardBubbleViews::USER_GESTURE 1317 view->Show(is_user_gesture ? autofill::SaveCardBubbleViews::USER_GESTURE
1311 : autofill::SaveCardBubbleViews::AUTOMATIC); 1318 : autofill::SaveCardBubbleViews::AUTOMATIC);
1312 return view; 1319 return view;
1313 } 1320 }
1314 1321
1315 void BrowserView::ShowTranslateBubble( 1322 void BrowserView::ShowTranslateBubble(
1316 content::WebContents* web_contents, 1323 content::WebContents* web_contents,
1317 translate::TranslateStep step, 1324 translate::TranslateStep step,
1318 translate::TranslateErrors::Type error_type, 1325 translate::TranslateErrors::Type error_type,
1319 bool is_user_gesture) { 1326 bool is_user_gesture) {
1320 if (contents_web_view_->HasFocus() && 1327 if (contents_web_view_->HasFocus() &&
1321 !GetLocationBarView()->IsMouseHovered()) { 1328 !GetLocationBarView()->IsMouseHovered()) {
1322 content::RenderViewHost* rvh = web_contents->GetRenderViewHost(); 1329 content::RenderViewHost* rvh = web_contents->GetRenderViewHost();
1323 if (rvh->IsFocusedElementEditable()) 1330 if (rvh->IsFocusedElementEditable())
1324 return; 1331 return;
1325 } 1332 }
1326 1333
1327 ChromeTranslateClient* chrome_translate_client = 1334 ChromeTranslateClient* chrome_translate_client =
1328 ChromeTranslateClient::FromWebContents(web_contents); 1335 ChromeTranslateClient::FromWebContents(web_contents);
1329 translate::LanguageState& language_state = 1336 translate::LanguageState& language_state =
1330 chrome_translate_client->GetLanguageState(); 1337 chrome_translate_client->GetLanguageState();
1331 language_state.SetTranslateEnabled(true); 1338 language_state.SetTranslateEnabled(true);
1332 1339
1333 if (IsMinimized()) 1340 if (IsMinimized())
1334 return; 1341 return;
1335 1342
1343 views::WidgetObserverView* anchor_view =
1344 GetToolbarView()->GetTranslateBubbleAnchor();
1336 TranslateBubbleView::ShowBubble( 1345 TranslateBubbleView::ShowBubble(
1337 GetToolbarView()->GetTranslateBubbleAnchor(), web_contents, step, 1346 anchor_view, web_contents, step,
1338 error_type, is_user_gesture ? TranslateBubbleView::USER_GESTURE 1347 error_type, is_user_gesture ? TranslateBubbleView::USER_GESTURE
1339 : TranslateBubbleView::AUTOMATIC); 1348 : TranslateBubbleView::AUTOMATIC);
1349 anchor_view->ObserveWidget(
1350 TranslateBubbleView::GetCurrentBubble()->GetWidget());
1340 } 1351 }
1341 1352
1342 #if defined(ENABLE_ONE_CLICK_SIGNIN) 1353 #if defined(ENABLE_ONE_CLICK_SIGNIN)
1343 void BrowserView::ShowOneClickSigninBubble( 1354 void BrowserView::ShowOneClickSigninBubble(
1344 OneClickSigninBubbleType type, 1355 OneClickSigninBubbleType type,
1345 const base::string16& email, 1356 const base::string16& email,
1346 const base::string16& error_message, 1357 const base::string16& error_message,
1347 const StartSyncCallback& start_sync_callback) { 1358 const StartSyncCallback& start_sync_callback) {
1348 scoped_ptr<OneClickSigninBubbleDelegate> delegate; 1359 scoped_ptr<OneClickSigninBubbleDelegate> delegate;
1349 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); 1360 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser()));
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
2687 return immersive_mode_controller()->IsEnabled(); 2698 return immersive_mode_controller()->IsEnabled();
2688 } 2699 }
2689 2700
2690 views::Widget* BrowserView::GetBubbleAssociatedWidget() { 2701 views::Widget* BrowserView::GetBubbleAssociatedWidget() {
2691 return GetWidget(); 2702 return GetWidget();
2692 } 2703 }
2693 2704
2694 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { 2705 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() {
2695 return top_container_->GetBoundsInScreen(); 2706 return top_container_->GetBoundsInScreen();
2696 } 2707 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/location_bar/bubble_icon_view.h » ('j') | ui/views/controls/button/button.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698