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

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

Issue 1880853002: Convert ValidationMessageBubbleView to BubbleDialogDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: msw review Created 4 years, 8 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
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/cocoa/tab_dialogs_cocoa.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 void Browser::ShowValidationMessage(content::WebContents* web_contents, 1269 void Browser::ShowValidationMessage(content::WebContents* web_contents,
1270 const gfx::Rect& anchor_in_root_view, 1270 const gfx::Rect& anchor_in_root_view,
1271 const base::string16& main_text, 1271 const base::string16& main_text,
1272 const base::string16& sub_text) { 1272 const base::string16& sub_text) {
1273 validation_message_bubble_ = 1273 validation_message_bubble_ =
1274 TabDialogs::FromWebContents(web_contents) 1274 TabDialogs::FromWebContents(web_contents)
1275 ->ShowValidationMessage(anchor_in_root_view, main_text, sub_text); 1275 ->ShowValidationMessage(anchor_in_root_view, main_text, sub_text);
1276 } 1276 }
1277 1277
1278 void Browser::HideValidationMessage(content::WebContents* web_contents) { 1278 void Browser::HideValidationMessage(content::WebContents* web_contents) {
1279 validation_message_bubble_.reset(); 1279 if (validation_message_bubble_)
1280 validation_message_bubble_->CloseValidationMessage();
1280 } 1281 }
1281 1282
1282 void Browser::MoveValidationMessage(content::WebContents* web_contents, 1283 void Browser::MoveValidationMessage(content::WebContents* web_contents,
1283 const gfx::Rect& anchor_in_root_view) { 1284 const gfx::Rect& anchor_in_root_view) {
1284 if (!validation_message_bubble_) 1285 if (!validation_message_bubble_)
1285 return; 1286 return;
1286 RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView(); 1287 RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
1287 if (rwhv) { 1288 if (rwhv) {
1288 validation_message_bubble_->SetPositionRelativeToAnchor( 1289 validation_message_bubble_->SetPositionRelativeToAnchor(
1289 rwhv->GetRenderWidgetHost(), anchor_in_root_view); 1290 rwhv->GetRenderWidgetHost(), anchor_in_root_view);
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 if (contents && !allow_js_access) { 2745 if (contents && !allow_js_access) {
2745 contents->web_contents()->GetController().LoadURL( 2746 contents->web_contents()->GetController().LoadURL(
2746 target_url, 2747 target_url,
2747 content::Referrer(), 2748 content::Referrer(),
2748 ui::PAGE_TRANSITION_LINK, 2749 ui::PAGE_TRANSITION_LINK,
2749 std::string()); // No extra headers. 2750 std::string()); // No extra headers.
2750 } 2751 }
2751 2752
2752 return contents != NULL; 2753 return contents != NULL;
2753 } 2754 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/cocoa/tab_dialogs_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698