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

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

Issue 1950133009: DevTools: account for the display scale factor while validating manifest under emulation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment addressed Created 4 years, 7 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/chrome_browser.gypi » ('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 18 matching lines...) Expand all
29 #include "base/threading/thread_restrictions.h" 29 #include "base/threading/thread_restrictions.h"
30 #include "base/time/time.h" 30 #include "base/time/time.h"
31 #include "build/build_config.h" 31 #include "build/build_config.h"
32 #include "chrome/app/chrome_command_ids.h" 32 #include "chrome/app/chrome_command_ids.h"
33 #include "chrome/browser/app_mode/app_mode_utils.h" 33 #include "chrome/browser/app_mode/app_mode_utils.h"
34 #include "chrome/browser/autofill/personal_data_manager_factory.h" 34 #include "chrome/browser/autofill/personal_data_manager_factory.h"
35 #include "chrome/browser/background/background_contents.h" 35 #include "chrome/browser/background/background_contents.h"
36 #include "chrome/browser/background/background_contents_service.h" 36 #include "chrome/browser/background/background_contents_service.h"
37 #include "chrome/browser/background/background_contents_service_factory.h" 37 #include "chrome/browser/background/background_contents_service_factory.h"
38 #include "chrome/browser/banners/app_banner_manager_desktop.h" 38 #include "chrome/browser/banners/app_banner_manager_desktop.h"
39 #include "chrome/browser/banners/app_banner_manager_emulation.h"
39 #include "chrome/browser/browser_process.h" 40 #include "chrome/browser/browser_process.h"
40 #include "chrome/browser/browser_shutdown.h" 41 #include "chrome/browser/browser_shutdown.h"
41 #include "chrome/browser/character_encoding.h" 42 #include "chrome/browser/character_encoding.h"
42 #include "chrome/browser/chrome_notification_types.h" 43 #include "chrome/browser/chrome_notification_types.h"
43 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 44 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
44 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 45 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
45 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 46 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
46 #include "chrome/browser/custom_handlers/register_protocol_handler_permission_re quest.h" 47 #include "chrome/browser/custom_handlers/register_protocol_handler_permission_re quest.h"
47 #include "chrome/browser/defaults.h" 48 #include "chrome/browser/defaults.h"
48 #include "chrome/browser/devtools/devtools_toggle_action.h" 49 #include "chrome/browser/devtools/devtools_toggle_action.h"
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 Browser* browser = chrome::FindBrowserWithWebContents( 1441 Browser* browser = chrome::FindBrowserWithWebContents(
1441 WebContents::FromRenderFrameHost(frame)); 1442 WebContents::FromRenderFrameHost(frame));
1442 BubbleReference bubble_reference = 1443 BubbleReference bubble_reference =
1443 browser->GetBubbleManager()->ShowBubble(std::move(bubble_controller)); 1444 browser->GetBubbleManager()->ShowBubble(std::move(bubble_controller));
1444 bubble_controller_ptr->set_bubble_reference(bubble_reference); 1445 bubble_controller_ptr->set_bubble_reference(bubble_reference);
1445 1446
1446 return std::move(bluetooth_chooser_desktop); 1447 return std::move(bluetooth_chooser_desktop);
1447 } 1448 }
1448 1449
1449 void Browser::RequestAppBannerFromDevTools(content::WebContents* web_contents) { 1450 void Browser::RequestAppBannerFromDevTools(content::WebContents* web_contents) {
1450 banners::AppBannerManagerDesktop::CreateForWebContents(web_contents); 1451 banners::AppBannerManagerEmulation::CreateForWebContents(web_contents);
sky 2016/05/06 21:48:12 Why does this code need to be in Browser? AFAICT i
1451 RequestAppBanner(web_contents); 1452 banners::AppBannerManagerEmulation* manager =
1452 } 1453 banners::AppBannerManagerEmulation::FromWebContents(web_contents);
1453 1454 manager->RequestAppBanner(web_contents->GetMainFrame(),
1454 bool Browser::RequestAppBanner(content::WebContents* web_contents) { 1455 web_contents->GetLastCommittedURL(), true);
1455 banners::AppBannerManagerDesktop* manager =
1456 banners::AppBannerManagerDesktop::FromWebContents(web_contents);
1457 if (manager) {
1458 manager->RequestAppBanner(web_contents->GetMainFrame(),
1459 web_contents->GetLastCommittedURL(), true);
1460 return true;
1461 }
1462
1463 web_contents->GetMainFrame()->AddMessageToConsole(
1464 content::CONSOLE_MESSAGE_LEVEL_DEBUG,
1465 "App banners are currently disabled. Please check chrome://flags/#" +
1466 std::string(switches::kEnableAddToShelf));
1467 return false;
1468 } 1456 }
1469 1457
1470 bool Browser::IsMouseLocked() const { 1458 bool Browser::IsMouseLocked() const {
1471 return exclusive_access_manager_->mouse_lock_controller()->IsMouseLocked(); 1459 return exclusive_access_manager_->mouse_lock_controller()->IsMouseLocked();
1472 } 1460 }
1473 1461
1474 void Browser::OnWindowDidShow() { 1462 void Browser::OnWindowDidShow() {
1475 if (window_has_shown_) 1463 if (window_has_shown_)
1476 return; 1464 return;
1477 window_has_shown_ = true; 1465 window_has_shown_ = true;
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2745 if (contents && !allow_js_access) { 2733 if (contents && !allow_js_access) {
2746 contents->web_contents()->GetController().LoadURL( 2734 contents->web_contents()->GetController().LoadURL(
2747 target_url, 2735 target_url,
2748 content::Referrer(), 2736 content::Referrer(),
2749 ui::PAGE_TRANSITION_LINK, 2737 ui::PAGE_TRANSITION_LINK,
2750 std::string()); // No extra headers. 2738 std::string()); // No extra headers.
2751 } 2739 }
2752 2740
2753 return contents != NULL; 2741 return contents != NULL;
2754 } 2742 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698